<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>How To PHP - PHP Technology, PHP Tutorial, Database Tutorials, CMS System &#187; MySQL</title>
	<atom:link href="http://www.phpmind.com/blog/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmind.com/blog</link>
	<description>Future of web development</description>
	<lastBuildDate>Tue, 25 Oct 2011 21:38:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MYSQL data manipulation language (DML) commands?</title>
		<link>http://www.phpmind.com/blog/2010/12/mysql-data-manipulation-language-dml-commands/</link>
		<comments>http://www.phpmind.com/blog/2010/12/mysql-data-manipulation-language-dml-commands/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 09:14:47 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=1035</guid>
		<description><![CDATA[Data Manipulation Language Data Manipulation Language (DML) statements are used for managing data within tables. Some commands of DML are: View Code MYSQL&#160; 1. SELECT - retrieve data from the a database 2. INSERT - insert data into a table 3. UPDATE - updates existing data within a table 4. DELETE - deletes all records [...]]]></description>
			<content:encoded><![CDATA[<p>Data Manipulation Language</p>
<p>Data Manipulation Language (DML) statements are used for managing data within tables. Some commands of DML are:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1035code2'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10352"><td class="code" id="p1035code2"><pre class="mysql" style="font-family:monospace;">&nbsp;
<span style="color: #008080;">1</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SELECT"><span style="color: #990099; font-weight: bold;">SELECT</span></a> <span style="color: #CC0099;">-</span> retrieve <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATA"><span style="color: #990099; font-weight: bold;">data</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">from</span></a> the a <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATABASE"><span style="color: #990099; font-weight: bold;">database</span></a>
<span style="color: #008080;">2</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INSERT"><span style="color: #990099; font-weight: bold;">INSERT</span></a> <span style="color: #CC0099;">-</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INSERT"><span style="color: #990099; font-weight: bold;">insert</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATA"><span style="color: #990099; font-weight: bold;">data</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INTO"><span style="color: #990099; font-weight: bold;">into</span></a> a <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a>
<span style="color: #008080;">3</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=UPDATE"><span style="color: #990099; font-weight: bold;">UPDATE</span></a> <span style="color: #CC0099;">-</span> updates existing <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATA"><span style="color: #990099; font-weight: bold;">data</span></a> <a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/analysing-spatial-information.html"><span style="color: #00CC00;">within</span></a> a <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a>
<span style="color: #008080;">4</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DELETE"><span style="color: #990099; font-weight: bold;">DELETE</span></a> <span style="color: #CC0099;">-</span> deletes <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ALL"><span style="color: #990099; font-weight: bold;">all</span></a> records <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">from</span></a> a <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a><span style="color: #000033;">,</span> the <a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html"><span style="color: #000099;">space</span></a> for the records remain
<span style="color: #008080;">5</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=MERGE"><span style="color: #990099; font-weight: bold;">MERGE</span></a> <span style="color: #CC0099;">-</span> UPSERT operation <span style="color: #FF00FF;">&#40;</span><a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INSERT"><span style="color: #990099; font-weight: bold;">insert</span></a> <a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html"><span style="color: #CC0099; font-weight: bold;">or</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=UPDATE"><span style="color: #990099; font-weight: bold;">update</span></a><span style="color: #FF00FF;">&#41;</span>
<span style="color: #008080;">6</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=CALL"><span style="color: #990099; font-weight: bold;">CALL</span></a> <span style="color: #CC0099;">-</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=CALL"><span style="color: #990099; font-weight: bold;">call</span></a> a PL<span style="color: #CC0099;">/</span>SQL <a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html"><span style="color: #CC0099; font-weight: bold;">or</span></a> Java<span style="color: #CC0099;">/</span>php subprogram
<span style="color: #008080;">7</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=LOCK"><span style="color: #990099; font-weight: bold;">LOCK</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">TABLE</span></a> <span style="color: #CC0099;">-</span> control concurrency</pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F12%2Fmysql-data-manipulation-language-dml-commands%2F&amp;title=MYSQL%20data%20manipulation%20language%20%28DML%29%20commands%3F" id="wpa2a_2"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/12/mysql-data-manipulation-language-dml-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MYSQL data definition language (DDL) commands?</title>
		<link>http://www.phpmind.com/blog/2010/12/mysql-data-definition-language-ddl-commands/</link>
		<comments>http://www.phpmind.com/blog/2010/12/mysql-data-definition-language-ddl-commands/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 09:13:04 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=1033</guid>
		<description><![CDATA[Data Definition Language (DDL) DDL statements are used to define and modify the database structure of your tables or schema. When you execute a DDL statement, it takes effect immediately. Some commands of DDL are: View Code MYSQL1. CREATE - to create table &#40;objects&#41; in the database 2. ALTER - alters the structure of the [...]]]></description>
			<content:encoded><![CDATA[<p>Data Definition Language (DDL)</p>
<p>DDL statements are used to define and modify the database structure of your tables or schema. When you execute a DDL statement, it takes effect immediately.<br />
Some commands of DDL are:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1033code4'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10334"><td class="code" id="p1033code4"><pre class="mysql" style="font-family:monospace;"><span style="color: #008080;">1</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=CREATE"><span style="color: #990099; font-weight: bold;">CREATE</span></a> <span style="color: #CC0099;">-</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TO"><span style="color: #990099; font-weight: bold;">to</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=CREATE"><span style="color: #990099; font-weight: bold;">create</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a> <span style="color: #FF00FF;">&#40;</span>objects<span style="color: #FF00FF;">&#41;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=IN"><span style="color: #990099; font-weight: bold;">in</span></a> the <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATABASE"><span style="color: #990099; font-weight: bold;">database</span></a>
<span style="color: #008080;">2</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ALTER"><span style="color: #990099; font-weight: bold;">ALTER</span></a> <span style="color: #CC0099;">-</span> alters the structure of the <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATABASE"><span style="color: #990099; font-weight: bold;">database</span></a>
<span style="color: #008080;">3</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DROP"><span style="color: #990099; font-weight: bold;">DROP</span></a> <span style="color: #CC0099;">-</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DELETE"><span style="color: #990099; font-weight: bold;">delete</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">from</span></a> the <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATABASE"><span style="color: #990099; font-weight: bold;">database</span></a>
<span style="color: #008080;">4</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TRUNCATE"><span style="color: #990099; font-weight: bold;">TRUNCATE</span></a> <span style="color: #CC0099;">-</span> remove <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ALL"><span style="color: #990099; font-weight: bold;">all</span></a> records <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">from</span></a> a <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a><span style="color: #000033;">,</span> including <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ALL"><span style="color: #990099; font-weight: bold;">all</span></a> spaces allocated for the records are removed
<span style="color: #008080;">5</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=COMMENT"><span style="color: #990099; font-weight: bold;">COMMENT</span></a> <span style="color: #CC0099;">-</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ADD"><span style="color: #990099; font-weight: bold;">add</span></a> comments <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TO"><span style="color: #990099; font-weight: bold;">to</span></a> the <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATA"><span style="color: #990099; font-weight: bold;">data</span></a> dictionary
<span style="color: #008080;">6</span>. <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=RENAME"><span style="color: #990099; font-weight: bold;">RENAME</span></a> <span style="color: #CC0099;">-</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=RENAME"><span style="color: #990099; font-weight: bold;">rename</span></a> a <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TABLE"><span style="color: #990099; font-weight: bold;">table</span></a></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F12%2Fmysql-data-definition-language-ddl-commands%2F&amp;title=MYSQL%20data%20definition%20language%20%28DDL%29%20commands%3F" id="wpa2a_4"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/12/mysql-data-definition-language-ddl-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to backup and restore a MySQL database?</title>
		<link>http://www.phpmind.com/blog/2010/12/how-to-backup-and-restore-a-mysql-database/</link>
		<comments>http://www.phpmind.com/blog/2010/12/how-to-backup-and-restore-a-mysql-database/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 09:10:49 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=1031</guid>
		<description><![CDATA[You can use mysqldump to create a simple backup of your database using the following syntax. View Code MYSQLmysqldump -u &#91;username&#93; -p &#91;password&#93; &#91;databasename&#93; &#62; &#91;backupfile.sql&#93; &#160; &#160; To Restore mysql -u &#91;username&#93; -p &#91;password&#93; &#91;database_to_restore&#93; &#60; &#91;backupfile&#93;]]></description>
			<content:encoded><![CDATA[<p>You can use mysqldump to create a simple backup of your database using the following syntax.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1031code6'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10316"><td class="code" id="p1031code6"><pre class="mysql" style="font-family:monospace;">mysqldump <span style="color: #CC0099;">-</span>u <span style="color: #FF00FF;">&#91;</span>username<span style="color: #FF00FF;">&#93;</span> <span style="color: #CC0099;">-</span>p <span style="color: #FF00FF;">&#91;</span><a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/encryption-functions.html"><span style="color: #000099;">password</span></a><span style="color: #FF00FF;">&#93;</span> <span style="color: #FF00FF;">&#91;</span>databasename<span style="color: #FF00FF;">&#93;</span> <span style="color: #CC0099;">&gt;</span> <span style="color: #FF00FF;">&#91;</span>backupfile.sql<span style="color: #FF00FF;">&#93;</span>
&nbsp;
&nbsp;
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TO"><span style="color: #990099; font-weight: bold;">To</span></a> Restore 
mysql <span style="color: #CC0099;">-</span>u <span style="color: #FF00FF;">&#91;</span>username<span style="color: #FF00FF;">&#93;</span> <span style="color: #CC0099;">-</span>p <span style="color: #FF00FF;">&#91;</span><a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/encryption-functions.html"><span style="color: #000099;">password</span></a><span style="color: #FF00FF;">&#93;</span> <span style="color: #FF00FF;">&#91;</span>database_to_restore<span style="color: #FF00FF;">&#93;</span> <span style="color: #CC0099;">&lt;</span> <span style="color: #FF00FF;">&#91;</span>backupfile<span style="color: #FF00FF;">&#93;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F12%2Fhow-to-backup-and-restore-a-mysql-database%2F&amp;title=How%20to%20backup%20and%20restore%20a%20MySQL%20database%3F" id="wpa2a_6"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/12/how-to-backup-and-restore-a-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySql frequently used commands?</title>
		<link>http://www.phpmind.com/blog/2010/09/what-are-mysql-frequently-used-commands/</link>
		<comments>http://www.phpmind.com/blog/2010/09/what-are-mysql-frequently-used-commands/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 03:23:41 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=902</guid>
		<description><![CDATA[MySQL is one of the best and globally used database. It will be good to learn the basic commands in Mysql to work interactively with the website and database servers. It is an GPL software as well as paid version is available with support. MySQL uses Structured Query Language (SQL-pronounced sequel), here i have listed [...]]]></description>
			<content:encoded><![CDATA[<div class="boxcenter">
<p><img class="alignleft size-full wp-image-910" title="phpmind-mysql" src="http://www.phpmind.com/blog/wp-content/uploads/2010/09/phpmind-mysql.gif" alt="" width="321" height="159" />MySQL is one of the best and globally used database. It will be good to learn the basic commands in Mysql to work interactively with the website and database servers. It is an GPL software as well as paid version is available with support. MySQL uses Structured Query Language (SQL-pronounced sequel), here i have listed mostly used commands  for requesting information from a database.  Mysql sends each SQL statement that you issue to the server to be executed.  Because of its fast performance, reliability, ease of use, and versatility in working with programming languages NASA, FedEx, Yahoo other big php application are using mysql as backend.</p>
<p><img class="alignleft size-full wp-image-915" title="phpmind-terminal" src="http://www.phpmind.com/blog/wp-content/uploads/2010/09/phpmind-terminal1.png" alt="" width="128" height="103" />This is a list of handy MySQL mysql-textboxs that I use time and time again. At the bottom are statements, clauses, and functions you can use in MySQL. Below that are PHP  functions you can use to interface with MySQL.</p>
<p>Below when you see # it means from the unix shell. When you see mysql&gt; it means from a MySQL prompt after logging into MySQL.</p>
<h4>To login (from unix shell) use -h only if needed.</h4>
<p class="mysql-textbox"># [mysql dir]/bin/mysql -h hostname -u root -p</p>
<h4>Create a database on the sql server.</h4>
<p class="mysql-textbox">mysql&gt; create database [databasename];</p>
<h4>List all databases on the sql server.</h4>
<p class="mysql-textbox">mysql&gt; show databases;</p>
<h4>Switch to a database.</h4>
<p class="mysql-textbox">mysql&gt; use [db name];</p>
<h4>To see all the tables in the db.</h4>
<p class="mysql-textbox">mysql&gt; show tables;</p>
<h4>To see database&#8217;s field formats.</h4>
<p class="mysql-textbox">mysql&gt; describe [table name];</p>
<h4>To delete a db.</h4>
<p class="mysql-textbox">mysql&gt; drop database [database name];</p>
<h4>To delete a table.</h4>
<p class="mysql-textbox">mysql&gt; drop table [table name];</p>
<h4>Show all data in a table.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name];</p>
<h4>Returns the columns and column information pertaining to the designated table.</h4>
<p class="mysql-textbox">mysql&gt; show columns from [table name];</p>
<h4>Show certain selected rows with the value &#8220;whatever&#8221;.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name] WHERE [field name] = &#8220;whatever&#8221;;</p>
<h4>Show all records containing the name &#8220;Bob&#8221; AND the phone number &#8217;3444444&#8242;.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name] WHERE name = &#8220;Bob&#8221; AND phone_number = &#8217;3444444&#8242;;</p>
<h4>Show all records not containing the name &#8220;Bob&#8221; AND the phone number &#8217;3444444&#8242; order by the phone_number field.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name] WHERE name != &#8220;Bob&#8221; AND phone_number = &#8217;3444444&#8242; order by phone_number;</p>
<h4>Show all records starting with the letters &#8216;bob&#8217; AND the phone number &#8217;3444444&#8242;.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name] WHERE name like &#8220;Bob%&#8221; AND phone_number = &#8217;3444444&#8242;;</p>
<h4>Show all records starting with the letters &#8216;bob&#8217; AND the phone number &#8217;3444444&#8242; limit to records 1 through 5.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name] WHERE name like &#8220;Bob%&#8221; AND phone_number = &#8217;3444444&#8242; limit 1,5;</p>
<h4>Use a regular expression to find records. Use &#8220;REGEXP BINARY&#8221; to force case-sensitivity. This finds any record beginning with a.</h4>
<p class="mysql-textbox">mysql&gt; SELECT * FROM [table name] WHERE rec RLIKE &#8220;^a&#8221;;</p>
<h4>Show unique records.</h4>
<p class="mysql-textbox">mysql&gt; SELECT DISTINCT [column name] FROM [table name];</p>
<h4>Show selected records sorted in an ascending (asc) or descending (desc).</h4>
<p class="mysql-textbox">mysql&gt; SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;</p>
<h4>Return number of rows.</h4>
<p class="mysql-textbox">mysql&gt; SELECT COUNT(*) FROM [table name];</p>
<h4>Sum column.</h4>
<p class="mysql-textbox">mysql&gt; SELECT SUM(*) FROM [table name];</p>
<h4>Join tables on common columns.</h4>
<p class="mysql-textbox">mysql&gt; select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on<br />
lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;</p>
<h4>Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.</h4>
<p class="mysql-textbox"># mysql -u root -p</p>
<p>mysql&gt; use mysql;</p>
<p>mysql&gt; INSERT INTO user (Host,User,Password) VALUES(&#8216;%&#8217;,'username&#8217;,PASSWORD(&#8216;password&#8217;));</p>
<p>mysql&gt; flush privileges;</p>
<h4>Change a users password from unix shell.</h4>
<p class="mysql-textbox"># [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password &#8216;new-password&#8217;</p>
<h4>Change a users password from MySQL prompt. Login as root. Set the password. Update privs.</h4>
<p class="mysql-textbox"># mysql -u root -p</p>
<p>mysql&gt; SET PASSWORD FOR &#8216;user&#8217;@'hostname&#8217; = PASSWORD(&#8216;passwordhere&#8217;);</p>
<p>mysql&gt; flush privileges;</p>
<h4>Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables.<br />
Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.</h4>
<p class="mysql-textbox"># /etc/init.d/mysql stop</p>
<p># mysqld_safe &#8211;skip-grant-tables &amp;</p>
<p># mysql -u root</p>
<p>mysql&gt; use mysql;</p>
<p>mysql&gt; update user set password=PASSWORD(&#8220;newrootpassword&#8221;) where User=&#8217;root&#8217;;</p>
<p>mysql&gt; flush privileges;</p>
<p>mysql&gt; quit</p>
<p># /etc/init.d/mysql stop</p>
<p># /etc/init.d/mysql start</p>
<h4>Set a root password if there is on root password.</h4>
<p class="mysql-textbox"># mysqladmin -u root password newpassword</p>
<h4>Update a root password.</h4>
<p class="mysql-textbox"># mysqladmin -u root -p oldpassword newpassword</p>
<h4>Allow the user &#8220;bob&#8221; to connect to the server from localhost using the password &#8220;passwd&#8221;.<br />
Login as root. Switch to the MySQL db. Give privs. Update privs.</h4>
<p class="mysql-textbox"># mysql -u root -p</p>
<p>mysql&gt; use mysql;</p>
<p>mysql&gt; grant usage on *.* to bob@localhost identified by &#8216;passwd&#8217;;</p>
<p>mysql&gt; flush privileges;</p>
<h4>Give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs.</h4>
<p class="mysql-textbox"># mysql -u root -p</p>
<p>mysql&gt; use mysql;</p>
<p>mysql&gt; INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES<br />
(&#8216;%&#8217;,'databasename&#8217;,'username&#8217;,'Y&#8217;,'Y&#8217;,'Y&#8217;,'Y&#8217;,'Y&#8217;,'N&#8217;);</p>
<p>mysql&gt; flush privileges;</p>
<p>or</p>
<p>mysql&gt; grant all privileges on databasename.* to username@localhost;</p>
<p>mysql&gt; flush privileges;</p>
<h4>To update info already in a table.</h4>
<p class="mysql-textbox">mysql&gt; UPDATE [table name] SET Select_priv = &#8216;Y&#8217;,Insert_priv = &#8216;Y&#8217;,Update_priv = &#8216;Y&#8217; where [field name] = &#8216;user&#8217;;</p>
<h4>Delete a row(s) from a table.</h4>
<p class="mysql-textbox">mysql&gt; DELETE from [table name] where [field name] = &#8216;whatever&#8217;;</p>
<h4>Update database permissions/privilages.</h4>
<p class="mysql-textbox">mysql&gt; flush privileges;</p>
<h4>Delete a column.</h4>
<p class="mysql-textbox">mysql&gt; alter table [table name] drop column [column name];</p>
<h4>Add a new column to db.</h4>
<p class="mysql-textbox">mysql&gt; alter table [table name] add column [new column name] varchar (20);</p>
<h4>Change column name.</h4>
<p class="mysql-textbox">mysql&gt; alter table [table name] change [old column name] [new column name] varchar (50);</p>
<h4>Make a unique column so you get no dupes.</h4>
<p class="mysql-textbox">mysql&gt; alter table [table name] add unique ([column name]);</p>
<h4>Make a column bigger.</h4>
<p class="mysql-textbox">mysql&gt; alter table [table name] modify [column name] VARCHAR(3);</p>
<h4>Delete unique from table.</h4>
<p class="mysql-textbox">mysql&gt; alter table [table name] drop index [colmn name];</p>
<h4>Load a CSV file into a table.</h4>
<p class="mysql-textbox">mysql&gt; LOAD DATA INFILE &#8216;/tmp/filename.csv&#8217; replace INTO TABLE [table name] FIELDS TERMINATED BY &#8216;,&#8217; LINES TERMINATED BY &#8216;\n&#8217; (field1,field2,field3);</p>
<h4>Dump all databases for backup. Backup file is sql mysql-textboxs to recreate all db&#8217;s.</h4>
<p class="mysql-textbox"># [mysql dir]/bin/mysqldump -u root -ppassword &#8211;opt &gt;/tmp/alldatabases.sql</p>
<h4>Dump one database for backup.</h4>
<p class="mysql-textbox"># [mysql dir]/bin/mysqldump -u username -ppassword &#8211;databases databasename &gt;/tmp/databasename.sql</p>
<h4>Dump a table from a database.</h4>
<p class="mysql-textbox"># [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename &gt; /tmp/databasename.tablename.sql</p>
<h4>Restore database (or database table) from backup.</h4>
<p class="mysql-textbox"># [mysql dir]/bin/mysql -u username -ppassword databasename &lt; /tmp/databasename.sql</p>
<h4>Create Table Example 1.</h4>
<p class="mysql-textbox">mysql&gt; CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid<br />
VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));</p>
<h4>Create Table Example 2.</h4>
<p class="mysql-textbox">mysql&gt; create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default<br />
&#8216;bato&#8217;);</p>
<table border="0" cellspacing="2" cellpadding="4" width="100%">
<tbody>
<tr>
<td class="mysql-textbox" width="33%"><strong>MYSQL Statements and clauses</strong></td>
<td class="mysql-textbox" width="32%"><strong>String Functions</strong></td>
<td class="mysql-textbox" width="35%"><strong>Date and Time Functions</strong></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">ALTER DATABASE</p>
<p>ALTER TABLE</p>
<p>ALTER VIEW</p>
<p>ANALYZE TABLE</p>
<p>BACKUP TABLE</p>
<p>CACHE INDEX</p>
<p>CHANGE MASTER TO</p>
<p>CHECK TABLE</p>
<p>CHECKSUM TABLE</p>
<p>COMMIT</p>
<p>CREATE DATABASE</p>
<p>CREATE INDEX</p>
<p>CREATE TABLE</p>
<p>CREATE VIEW</p>
<p>DELETE</p>
<p>DESCRIBE</p>
<p>DO</p>
<p>DROP DATABASE</p>
<p>DROP INDEX</p>
<p>DROP TABLE</p>
<p>DROP USER</p>
<p>DROP VIEW</p>
<p>EXPLAIN</p>
<p>FLUSH</p>
<p>GRANT</p>
<p>HANDLER</p>
<p>INSERT</p>
<p>JOIN</p>
<p>KILL</p>
<p>LOAD DATA FROM MASTER</p>
<p>LOAD DATA INFILE</p>
<p>LOAD INDEX INTO CACHE</p>
<p>LOAD TABLE&#8230;FROM MASTER</p>
<p>LOCK TABLES</p>
<p>OPTIMIZE TABLE</p>
<p>PURGE MASTER LOGS</p>
<p>RENAME TABLE</p>
<p>REPAIR TABLE</p>
<p>REPLACE</p>
<p>RESET</p>
<p>RESET MASTER</p>
<p>RESET SLAVE</p>
<p>RESTORE TABLE</p>
<p>REVOKE</p>
<p>ROLLBACK</p>
<p>ROLLBACK TO SAVEPOINT</p>
<p>SAVEPOINT</p>
<p>SELECT</p>
<p>SET</p>
<p>SET PASSWORD</p>
<p>SET SQL_LOG_BIN</p>
<p>SET TRANSACTION</p>
<p>SHOW BINLOG EVENTS</p>
<p>SHOW CHARACTER SET</p>
<p>SHOW COLLATION</p>
<p>SHOW COLUMNS</p>
<p>SHOW CREATE DATABASE</p>
<p>SHOW CREATE TABLE</p>
<p>SHOW CREATE VIEW</p>
<p>SHOW DATABASES</p>
<p>SHOW ENGINES</p>
<p>SHOW ERRORS</p>
<p>SHOW GRANTS</p>
<p>SHOW INDEX</p>
<p>SHOW INNODB STATUS</p>
<p>SHOW LOGS</p>
<p>SHOW MASTER LOGS</p>
<p>SHOW MASTER STATUS</p>
<p>SHOW PRIVILEGES</p>
<p>SHOW PROCESSLIST</p>
<p>SHOW SLAVE HOSTS</p>
<p>SHOW SLAVE STATUS</p>
<p>SHOW STATUS</p>
<p>SHOW TABLE STATUS</p>
<p>SHOW TABLES</p>
<p>SHOW VARIABLES</p>
<p>SHOW WARNINGS</p>
<p>START SLAVE</p>
<p>START TRANSACTION</p>
<p>STOP SLAVE</p>
<p>TRUNCATE TABLE</p>
<p>UNION</p>
<p>UNLOCK TABLES</p>
<p>USE</td>
<td width="32%" align="left" valign="top">AES_DECRYPT</p>
<p>AES_ENCRYPT</p>
<p>ASCII</p>
<p>BIN</p>
<p>BINARY</p>
<p>BIT_LENGTH</p>
<p>CHAR</p>
<p>CHAR_LENGTH</p>
<p>CHARACTER_LENGTH</p>
<p>COMPRESS</p>
<p>CONCAT</p>
<p>CONCAT_WS</p>
<p>CONV</p>
<p>DECODE</p>
<p>DES_DECRYPT</p>
<p>DES_ENCRYPT</p>
<p>ELT</p>
<p>ENCODE</p>
<p>ENCRYPT</p>
<p>EXPORT_SET</p>
<p>FIELD</p>
<p>FIND_IN_SET</p>
<p>HEX</p>
<p>INET_ATON</p>
<p>INET_NTOA</p>
<p>INSERT</p>
<p>INSTR</p>
<p>LCASE</p>
<p>LEFT</p>
<p>LENGTH</p>
<p>LOAD_FILE</p>
<p>LOCATE</p>
<p>LOWER</p>
<p>LPAD</p>
<p>LTRIM</p>
<p>MAKE_SET</p>
<p>MATCH AGAINST</p>
<p>MD5</p>
<p>MID</p>
<p>OCT</p>
<p>OCTET_LENGTH</p>
<p>OLD_PASSWORD</p>
<p>ORD</p>
<p>PASSWORD</p>
<p>POSITION</p>
<p>QUOTE</p>
<p>REPEAT</p>
<p>REPLACE</p>
<p>REVERSE</p>
<p>RIGHT</p>
<p>RPAD</p>
<p>RTRIM</p>
<p>SHA</p>
<p>SHA1</p>
<p>SOUNDEX</p>
<p>SPACE</p>
<p>STRCMP</p>
<p>SUBSTRING</p>
<p>SUBSTRING_INDEX</p>
<p>TRIM</p>
<p>UCASE</p>
<p>UNCOMPRESS</p>
<p>UNCOMPRESSED_LENGTH</p>
<p>UNHEX</p>
<p>UPPER</td>
<td width="35%" align="left" valign="top">ADDDATE</p>
<p>ADDTIME</p>
<p>CONVERT_TZ</p>
<p>CURDATE</p>
<p>CURRENT_DATE</p>
<p>CURRENT_TIME</p>
<p>CURRENT_TIMESTAMP</p>
<p>CURTIME</p>
<p>DATE</p>
<p>DATE_ADD</p>
<p>DATE_FORMAT</p>
<p>DATE_SUB</p>
<p>DATEDIFF</p>
<p>DAY</p>
<p>DAYNAME</p>
<p>DAYOFMONTH</p>
<p>DAYOFWEEK</p>
<p>DAYOFYEAR</p>
<p>EXTRACT</p>
<p>FROM_DAYS</p>
<p>FROM_UNIXTIME</p>
<p>GET_FORMAT</p>
<p>HOUR</p>
<p>LAST_DAY</p>
<p>LOCALTIME</p>
<p>LOCALTIMESTAMP</p>
<p>MAKEDATE</p>
<p>MAKETIME</p>
<p>MICROSECOND</p>
<p>MINUTE</p>
<p>MONTH</p>
<p>MONTHNAME</p>
<p>NOW</p>
<p>PERIOD_ADD</p>
<p>PERIOD_DIFF</p>
<p>QUARTER</p>
<p>SEC_TO_TIME</p>
<p>SECOND</p>
<p>STR_TO_DATE</p>
<p>SUBDATE</p>
<p>SUBTIME</p>
<p>SYSDATE</p>
<p>TIME</p>
<p>TIMEDIFF</p>
<p>TIMESTAMP</p>
<p>TIMESTAMPDIFF</p>
<p>TIMESTAMPADD</p>
<p>TIME_FORMAT</p>
<p>TIME_TO_SEC</p>
<p>TO_DAYS</p>
<p>UNIX_TIMESTAMP</p>
<p>UTC_DATE</p>
<p>UTC_TIME</p>
<p>UTC_TIMESTAMP</p>
<p>WEEK</p>
<p>WEEKDAY</p>
<p>WEEKOFYEAR</p>
<p>YEAR</p>
<p>YEARWEEK</td>
</tr>
<tr>
<td width="33%"></td>
<td width="32%"></td>
<td width="35%"></td>
</tr>
<tr>
<td width="33%"></td>
<td width="32%"></td>
<td width="35%"></td>
</tr>
<tr>
<td class="mysql-textbox" width="33%" align="left" valign="top"><strong>Mathematical and Aggregate Functions</strong></td>
<td class="mysql-textbox" width="32%" align="left" valign="top"><strong>Flow Control Functions/Command-Line Utilities</strong></td>
<td class="mysql-textbox" width="35%" align="left" valign="top"><strong>PHP API &#8211; using functions built into PHP with MySQL</strong></td>
</tr>
<tr>
<td align="left" valign="top">ABS</p>
<p>ACOS</p>
<p>ASIN</p>
<p>ATAN</p>
<p>ATAN2</p>
<p>AVG</p>
<p>BIT_AND</p>
<p>BIT_OR</p>
<p>BIT_XOR</p>
<p>CEIL</p>
<p>CEILING</p>
<p>COS</p>
<p>COT</p>
<p>COUNT</p>
<p>CRC32</p>
<p>DEGREES</p>
<p>EXP</p>
<p>FLOOR</p>
<p>FORMAT</p>
<p>GREATEST</p>
<p>GROUP_CONCAT</p>
<p>LEAST</p>
<p>LN</p>
<p>LOG</p>
<p>LOG2</p>
<p>LOG10</p>
<p>MAX</p>
<p>MIN</p>
<p>MOD</p>
<p>PI</p>
<p>POW</p>
<p>POWER</p>
<p>RADIANS</p>
<p>RAND</p>
<p>ROUND</p>
<p>SIGN</p>
<p>SIN</p>
<p>SQRT</p>
<p>STD</p>
<p>STDDEV</p>
<p>SUM</p>
<p>TAN</p>
<p>TRUNCATE</p>
<p>VARIANCE</td>
<td align="left" valign="top">CASE</p>
<p>IF</p>
<p>IFNULL</p>
<p>NULLIF</p>
<p><strong>Command-Line Utilities</strong></p>
<p>comp_err</p>
<p>isamchk</p>
<p>make_binary_distribution</p>
<p>msql2mysql</p>
<p>my_print_defaults</p>
<p>myisamchk</p>
<p>myisamlog</p>
<p>myisampack</p>
<p>mysqlaccess</p>
<p>mysqladmin</p>
<p>mysqlbinlog</p>
<p>mysqlbug</p>
<p>mysqlcheck</p>
<p>mysqldump</p>
<p>mysqldumpslow</p>
<p>mysqlhotcopy</p>
<p>mysqlimport</p>
<p>mysqlshow</p>
<p>perror</td>
<td align="left" valign="top">mysql_affected_rows</p>
<p>mysql_change_user</p>
<p>mysql_client_encoding</p>
<p>mysql_close</p>
<p>mysql_connect</p>
<p>mysql_create_db</p>
<p>mysql_data_seek</p>
<p>mysql_db_name</p>
<p>mysql_db_query</p>
<p>mysql_drop_db</p>
<p>mysql_errno</p>
<p>mysql_error</p>
<p>mysql_escape_string</p>
<p>mysql_fetch_array</p>
<p>mysql_fetch_assoc</p>
<p>mysql_fetch_field</p>
<p>mysql_fetch_lengths</p>
<p>mysql_fetch_object</p>
<p>mysql_fetch_row</p>
<p>mysql_field_flags</p>
<p>mysql_field_len</p>
<p>mysql_field_name</p>
<p>mysql_field_seek</p>
<p>mysql_field_table</p>
<p>mysql_field_type</p>
<p>mysql_free_result</p>
<p>mysql_get_client_info</p>
<p>mysql_get_host_info</p>
<p>mysql_get_proto_info</p>
<p>mysql_get_server_info</p>
<p>mysql_info</p>
<p>mysql_insert_id</p>
<p>mysql_list_dbs</p>
<p>mysql_list_fields</p>
<p>mysql_list_processes</p>
<p>mysql_list_tables</p>
<p>mysql_num_fields</p>
<p>mysql_num_rows</p>
<p>mysql_pconnect</p>
<p>mysql_ping</p>
<p>mysql_query</p>
<p>mysql_real_escape_string</p>
<p>mysql_result</p>
<p>mysql_select_db</p>
<p>mysql_stat</p>
<p>mysql_tablename</p>
<p>mysql_thread_id</p>
<p>mysql_unbuffered_query</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F09%2Fwhat-are-mysql-frequently-used-commands%2F&amp;title=MySql%20frequently%20used%20commands%3F" id="wpa2a_8"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/09/what-are-mysql-frequently-used-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is New In MySQL 5.0?</title>
		<link>http://www.phpmind.com/blog/2010/09/what-is-new-in-mysql-5-0/</link>
		<comments>http://www.phpmind.com/blog/2010/09/what-is-new-in-mysql-5-0/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 03:02:52 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=891</guid>
		<description><![CDATA[MySQL is mostly used for web development in the Linux environment. Specially LAMP. It is the &#8220;M&#8221; in the acronym LAMP (Linux operating system, Apache web server, MySQL database, and Perl / PHP / Python scripting languages). MySQL is usually described as open source. MySQL is actually available under both free and commercial licenses. MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL is mostly used for web development in the Linux environment. Specially LAMP. It is the &#8220;M&#8221; in the acronym LAMP (Linux operating system, Apache web server, MySQL database, and Perl / PHP / Python scripting languages).<br />
MySQL is usually described as open source. MySQL is actually available under both free and commercial licenses. MySQL is licensed under the GNU Public License (GPL).</p>
<p>Stored program objects are the most valuable significant upgrade to MySQL5.0.<br />
A) <strong>Views</strong><br />
B)  <strong>Stored Procedures</strong><br />
C) <strong> Functions</strong><br />
D)  <strong>Triggers</strong></p>
<h2>Views</h2>
<p>A view is a virtual table:  a SELECT statement with a name. Microsoft SQL Server calls them views as well; Microsoft Access calls them queries. Selecting from the view name executes the underlying SELECT statement, and returns the results as columns in the virtual table. MySQL views may be read only or updateable. A check option can be specified to prevent views from being updated with rows that they cannot themselves SELECT</p>
<p><strong>Disadvantage.</strong></p>
<p>It is not possible to create an index on a view.</p>
<p>Subqueries cannot be used in the <code>FROM</code> clause of       a view.</p>
<p>There is a general principle that you cannot modify a table and       select from the same table in a subquery.</p>
<p><strong>Example</strong></p>
<p>CREATE VIEW view_name AS<br />
SELECT column_name(s)<br />
FROM table_name<br />
WHERE condition</p>
<h2><strong>Stored procedures</strong></h2>
<p>Stored procedures are created via the CREATE PROCEDURE statement, and executed via the CALL statement. They may include input, output, and input-output parameters. MySQL stored procedures follow the SQL Server model, which permits a rowset to be returned simply by including a SELECT statement in the procedure. Unlike SQL Server, however, stored procedures in MySQL are not compiled. They do share many of the same advantages, such as standardizing code and reducing network traffic by performing business logic within the server.</p>
<h4><strong>Why use Stored Procedures?</strong></h4>
<p>Stored procedures are fast!  It takes some advantage of caching, just as prepared statements do. There is no compilation, so an SQL stored procedure won&#8217;t work as quickly as a procedure written with an external language such as C.<br />
2.  Stored procedures are components! Suppose that you change your host language &#8212; no problem, the logic is in the database not the application.<br />
3.  Stored procedures are portable! When you write your stored procedure in SQL, you know that it will run on every platform that MySQL runs on, without obliging you to install an additional runtime-environment package.<br />
4. Stored procedures are stored! If you write a procedure with the right naming conventions, for example saying chequing_withdrawal for a bank transaction, then people who want to know about chequing can find your procedure. It&#8217;s always available as &#8216;source code&#8217; in the database itself.<br />
5. Stored procedures are migratory! MySQL adheres fairly closely to the SQL:2003 standard. Others (DB2, Mimer) also adhere. Others (Oracle, SQL Server).</p>
<p>A stored procedure has a name, a parameter list, and an SQL  statement, which can contain many more SQL statements. There is new  syntax for local variables, error handling, loop control, and IF  conditions. Here is an example of a statement that creates a stored  procedure.</p>
<pre>CREATE PROCEDURE procedure1                /* name */
(IN parameter1 INTEGER)                    /* parameters */
BEGIN                                      /* start of block */
  DECLARE variable1 CHAR(10);                /* variables */
  IF parameter1 = 17 THEN                    /* start of IF */
    SET variable1 = 'birds';                   /* assignment */
  ELSE
    SET variable1 = 'beasts';                  /* assignment */
  END IF;                                   /* end of IF */
  INSERT INTO table1 VALUES (variable1);    /* statement */
END                                       /* end of block */</pre>
<p>What I&#8217;m going to do is explain in detail all the things you can do  with stored procedures. We&#8217;ll also get into another new database object,  triggers, because there is a tendency to associate triggers with stored  procedures.</p>
<h2>Triggers</h2>
<p>Triggers are event-driven stored procedures. They are tied to a specific table, and to an event on that table (INSERT, UPDATE, or DELETE). When the event occurs, the trigger is executed (or &#8220;fired&#8221;.)<br />
One key difference between MySQL triggers and those in SQL Server is that MySQL triggers can be called either before the triggering action or after it, whereas SQL Server triggers are after only. SQL Server does have an INSTEAD OF trigger not present in MySQL. Another key difference is the FOR EACH ROW syntax in MySQL, that will cause the trigger to execute for each row modified. The prefixes &#8220;OLD.&#8221; and &#8220;NEW.&#8221; enable the trigger body to reference columns before or after being modified. SQL Server triggers execute once per statement, and must take into account the possibility of multiple rows being affected.</p>
<h4>Storage enhancements and tools</h4>
<p>1.  VARCHAR can store max of 65,532 bytes<br />
2.  There is a new BIT datatype.<br />
3.  MySQL&#8217;s architecture uses plug-in storage engines to implement the physical storage of database tables.<br />
4.  Each table may use a different storage engine.<br />
5.  The default storage engine, MyISAM, is very fast but does not have the ability to capture transactions.<br />
6.  InnoDB storage engine is good for transactions, and aslo provide row-level locking.<br />
7.  The InnoDB engine uses a more compact storage format than previously.<br />
8.  MySql 5.0 have new storage engine types to the product: Archive, and Federated<br />
9.  The Federated storage engine enables access to remote tables, similar to a linked server definition in Microsoft SQL Server.<br />
10.  MySql now includes a set of graphical user interfaces for common administration and development tasks.</p>
<ul>
<li><strong>MySQL Instance Configuration Wizard</strong> &#8211; This tool is a step-by-step guide to configuring an instance of MySQL. Specifically, it creates the my.ini file, a text file containing startup configuration parameters.</li>
<li> <strong>MySQL Query Browser</strong> &#8211; This tool can be used to build queries and test them. It&#8217;s similar to Query Analyzer in SQL Server 7.0 and     2000, with a schemata browser</li>
<li> <strong>MySQL Administrator</strong> &#8211; Common administrative tasks such as creating, altering, and dropping tables in a database can be performed visually via the Table Editor. Indexes and constraints such as foreign keys can also be defined here.</li>
<li> <strong>MySQL System Tray Monitor </strong>- Similar to the Service Manager in SQL Server 2000, this tool puts an icon in the Windows SysTray to display the status of the MySQL Instance.</li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F09%2Fwhat-is-new-in-mysql-5-0%2F&amp;title=What%20is%20New%20In%20MySQL%205.0%3F" id="wpa2a_10"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/09/what-is-new-in-mysql-5-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Stop SQL Injection in MYSQL?</title>
		<link>http://www.phpmind.com/blog/2009/08/how-to-stop-sql-injection-in-mysql/</link>
		<comments>http://www.phpmind.com/blog/2009/08/how-to-stop-sql-injection-in-mysql/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 18:50:21 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[Easy PHP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=365</guid>
		<description><![CDATA[Every PHP-MYSQL programmer need to know Anti-SQL Injection. Please take a look at very simple function which can save your database!! View Code PHP&#60;?Php &#160; function ClearInput&#40;$dirty&#41;&#123; &#160; if &#40;get_magic_quotes_gpc&#40;&#41;&#41; &#123; &#160; $clean = mysql_real_escape_string&#40;stripslashes&#40;$dirty&#41;&#41;; &#160; &#125;else&#123; &#160; $clean = mysql_real_escape_string&#40;$dirty&#41;; &#160; &#125; return $clean; &#160; &#125; &#160; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>Every PHP-MYSQL programmer need to know Anti-SQL Injection. </p>
<p>Please take a look at very simple function which can save your database!!</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p365code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p3658"><td class="code" id="p365code8"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?Php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> ClearInput<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirty</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/get_magic_quotes_gpc"><span style="color: #990000;">get_magic_quotes_gpc</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$clean</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_real_escape_string"><span style="color: #990000;">mysql_real_escape_string</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/stripslashes"><span style="color: #990000;">stripslashes</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirty</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$clean</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_real_escape_string"><span style="color: #990000;">mysql_real_escape_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dirty</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$clean</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2009%2F08%2Fhow-to-stop-sql-injection-in-mysql%2F&amp;title=How%20to%20Stop%20SQL%20Injection%20in%20MYSQL%3F" id="wpa2a_12"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2009/08/how-to-stop-sql-injection-in-mysql/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Commonly Used MySQL Commands.</title>
		<link>http://www.phpmind.com/blog/2009/01/commonly-used-mysql-commands/</link>
		<comments>http://www.phpmind.com/blog/2009/01/commonly-used-mysql-commands/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 17:46:56 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=32</guid>
		<description><![CDATA[To login from linux shell - Mysql&#62;;  -h hostname -u root -p List all available databases with that username. Show databases; To use a database - Use dbname; To see tables within selected database; show tables; To see table field formats; describe [xyzTableName]; To delete database - Drop database [xyzDatabase]; To delete a table – [...]]]></description>
			<content:encoded><![CDATA[<p><strong>To login from linux shell</strong> -<br />
Mysql&gt;;  -h hostname -u root -p</p>
<p><strong>List all available databases with that username.</strong><br />
Show databases;</p>
<p><strong>To use a database -</strong><br />
Use dbname;</p>
<p><strong>To see tables within selected database;</strong><br />
show tables;</p>
<p><strong>To see table field formats;</strong><br />
describe [xyzTableName];</p>
<p><strong>To delete database -</strong><br />
Drop database [xyzDatabase];<br />
<strong><br />
To delete a table –</strong><br />
Drop table [xyzTableName];</p>
<p><strong>Show all data in a table –</strong><br />
SELECT * FROM  xyzTableName;</p>
<p></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2009%2F01%2Fcommonly-used-mysql-commands%2F&amp;title=Commonly%20Used%20MySQL%20Commands." id="wpa2a_14"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2009/01/commonly-used-mysql-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

