<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://knowledgenerd.net/index.php?action=history&amp;feed=atom&amp;title=MySQL_Server</id>
	<title>MySQL Server - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://knowledgenerd.net/index.php?action=history&amp;feed=atom&amp;title=MySQL_Server"/>
	<link rel="alternate" type="text/html" href="https://knowledgenerd.net/index.php?title=MySQL_Server&amp;action=history"/>
	<updated>2026-10-30T15:21:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://knowledgenerd.net/index.php?title=MySQL_Server&amp;diff=24&amp;oldid=prev</id>
		<title>Creator: /* MySQL Server Administration */</title>
		<link rel="alternate" type="text/html" href="https://knowledgenerd.net/index.php?title=MySQL_Server&amp;diff=24&amp;oldid=prev"/>
		<updated>2019-09-08T19:53:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;MySQL Server Administration&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 19:53, 8 September 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l166&quot; &gt;Line 166:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 166:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  /etc/mysql/my.cnf&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  /etc/mysql/my.cnf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== Reset mysql root password ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;service mysql stop&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mysqld_safe --skip-grant-tables &amp;amp;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Log into MySQL server&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mysql&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Replace NEW-PASS-HERE with desired new root password&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;UPDATE mysql.user SET Password=PASSWORD('NEW-PASS-HERE') WHERE User='root';&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;FLUSH PRIVILEGES;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;exit;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mysqladmin -u root -p shutdown&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;service mysql start&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Enable MySQL Server Slow Query Log ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Enable MySQL Server Slow Query Log ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key knowledgenerd:diff::1.12:old-20:rev-24 --&gt;
&lt;/table&gt;</summary>
		<author><name>Creator</name></author>
		
	</entry>
	<entry>
		<id>https://knowledgenerd.net/index.php?title=MySQL_Server&amp;diff=20&amp;oldid=prev</id>
		<title>Creator: Created page with &quot;== Linux Command Line Commands For MySQL Server ==  &lt;pre&gt; install mysql database ................. $sudo apt-get install mysql-server install mysql client ......................&quot;</title>
		<link rel="alternate" type="text/html" href="https://knowledgenerd.net/index.php?title=MySQL_Server&amp;diff=20&amp;oldid=prev"/>
		<updated>2019-09-08T19:04:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Linux Command Line Commands For MySQL Server ==  &amp;lt;pre&amp;gt; install mysql database ................. $sudo apt-get install mysql-server install mysql client ......................&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Linux Command Line Commands For MySQL Server ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install mysql database ................. $sudo apt-get install mysql-server&lt;br /&gt;
install mysql client ................... $sudo apt-get install mysql-client&lt;br /&gt;
&lt;br /&gt;
start mysql server ..................... $service mysql start&lt;br /&gt;
start mysql server ..................... $service mysqld start&lt;br /&gt;
start mysql server ..................... $/etc/init.d/mysql start&lt;br /&gt;
start mysql server ..................... $/etc/init.d/mysqld start&lt;br /&gt;
&lt;br /&gt;
stop mysql server ...................... $/etc/init.d/mysql stop&lt;br /&gt;
restart mysql server ................... $/etc/init.d/mysql restart&lt;br /&gt;
reload mysql server configurations ..... $/etc/init.d/mysql reload&lt;br /&gt;
reload mysql server configurations ..... $/etc/init.d/mysql force-reload&lt;br /&gt;
check the status of mysql server ....... $/etc/init.d/mysql status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preferred commands with some Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service mysql start&lt;br /&gt;
service mysql stop&lt;br /&gt;
service mysql restart&lt;br /&gt;
or&lt;br /&gt;
service mysqld start&lt;br /&gt;
service mysqld stop&lt;br /&gt;
service mysqld restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mac OS X Command Line Commands For MySQL Server ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start mysql server ..................... $sudo /usr/local/mysql/support-files/mysql.server start&lt;br /&gt;
stop mysql server ...................... $sudo /usr/local/mysql/support-files/mysql.server stop&lt;br /&gt;
restart mysql server ................... $sudo /usr/local/mysql/support-files/mysql.server restart&lt;br /&gt;
reload mysql server settings ........... $sudo /usr/local/mysql/support-files/mysql.server reload&lt;br /&gt;
force-reload mysql server settings ..... $sudo /usr/local/mysql/support-files/mysql.server force-reload&lt;br /&gt;
check the status of mysql server ....... $sudo /usr/local/mysql/support-files/mysql.server status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start MySQL Server at System Startup ===&lt;br /&gt;
&lt;br /&gt;
To start MySQL server automatically on MAC OS X system startup, create a property list file (.plist)&lt;br /&gt;
 sudo vim /Library/LaunchDaemons/com.mysql.mysql.plist&lt;br /&gt;
...and add the following lines to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!--?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?--&amp;gt;&lt;br /&gt;
&amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
    &amp;lt;key&amp;gt;KeepAlive&amp;lt;/key&amp;gt;&lt;br /&gt;
    &amp;lt;true /&amp;gt;&lt;br /&gt;
    &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;com.mysql.mysqld&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;&lt;br /&gt;
    &amp;lt;array&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;/usr/local/mysql/bin/mysqld_safe&amp;lt;/string&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;--user=mysql&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/array&amp;gt;        &lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&amp;lt;/plist&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then update permissions and add it to launchctl:  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist&lt;br /&gt;
sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist&lt;br /&gt;
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Disable MySQL Server at System Startup ===&lt;br /&gt;
&lt;br /&gt;
 sudo rm /Library/LaunchDaemons/com.mysql.mysql.plist&lt;br /&gt;
&lt;br /&gt;
Other way (which didn't work for me) is to search the service name:&lt;br /&gt;
 sudo launchctl list | grep -i mysql&lt;br /&gt;
and remove it e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo launchctl remove com.mysql.mysqld&lt;br /&gt;
sudo launchctl remove com.mysql.mysqld.plist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== mysql Tool Command Line Commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
connect local mysql server ............. $mysql -u root -p&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Execute a Query To DB With mysql Tool ===&lt;br /&gt;
&lt;br /&gt;
Create a new database:&lt;br /&gt;
 mysql -u root -p -e 'CREATE DATABASE drupal6_bu;'&lt;br /&gt;
&lt;br /&gt;
Show all PhpBBForum tables (starting with 'phpbb_') from Drupal6 database:&lt;br /&gt;
 mysql -u root -p -e 'USE Drupal6; SHOW TABLES;' | grep 'phpbb_'&lt;br /&gt;
or with different query and writing results into a file:&lt;br /&gt;
 mysql -u root -p -N information_schema -e &amp;quot;SELECT table_name FROM TABLES WHERE table_name LIKE 'phpbb_%' AND table_schema LIKE 'Drupal6'&amp;quot; &amp;gt; phpbb_tables.txt&lt;br /&gt;
&lt;br /&gt;
* Note: &amp;lt;code&amp;gt;-N, --skip-column-names | Don't write column names in results.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill Stuck Processes ===&lt;br /&gt;
&lt;br /&gt;
Connect remote mysql server (you have to have mysql client installed on current computer):&lt;br /&gt;
 mysql -u root -p -h 123.12.1.1&lt;br /&gt;
&lt;br /&gt;
Show ongoing processes:&lt;br /&gt;
 SHOW PROCESSLIST;&lt;br /&gt;
 SHOW FULL PROCESSLIST;&lt;br /&gt;
&lt;br /&gt;
Kill stuck processes (using the id of wanted process):&lt;br /&gt;
 KILL 8494378;&lt;br /&gt;
&lt;br /&gt;
Even it says e.g. &amp;lt;code&amp;gt;Query OK, 0 rows affected (0.00 sec)&amp;lt;/code&amp;gt;, the process was quite sure killed. Check if the process have disappeared:&lt;br /&gt;
 SHOW PROCESSLIST;&lt;br /&gt;
&lt;br /&gt;
=== Kill Multiple Stuck Processes ===&lt;br /&gt;
&lt;br /&gt;
MySQL doesn't have a query to kill multiple processes and you have to do it one by one. There's still couple handy ways to do that.&lt;br /&gt;
&lt;br /&gt;
'''From MySQL Server Command Line'''&lt;br /&gt;
&lt;br /&gt;
* Prepare a wanted sql query, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT * FROM information_schema.processlist&lt;br /&gt;
WHERE USER = 'drupal' AND DB = 'drupal6' AND TIME &amp;gt; 200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Option 1''': When you have all the processes as results which you want to terminate, execute following query, copy and clean the output and execute it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT CONCAT('KILL ', ID, ';') FROM information_schema.processlist&lt;br /&gt;
WHERE USER = 'drupal' AND DB = 'drupal6' AND TIME &amp;gt; 200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Option 2''': When you have all the processes as results which you want to terminate, execute following query and save kill statements to a file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELECT CONCAT('KILL ', ID, ';') FROM information_schema.processlist&lt;br /&gt;
WHERE USER = 'drupal' AND DB = 'drupal6' AND TIME &amp;gt; 200 INTO OUTFILE '/tmp/sql-kill-stuck.txt';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Execute commands from the created file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOURCE /tmp/sql-kill-stuck.txt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''From PHP-Script'''&lt;br /&gt;
&lt;br /&gt;
* Following is only an example, it's good to narrow the result set with WHERE statement so you don't kill e.g. possible replication threads.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$result = mysql_query(&amp;quot;SHOW FULL PROCESSLIST&amp;quot;);&lt;br /&gt;
while ($row=mysql_fetch_array($result)) {&lt;br /&gt;
  $process_id=$row[&amp;quot;Id&amp;quot;];&lt;br /&gt;
  if ($row[&amp;quot;Time&amp;quot;] &amp;gt; 200 ) {&lt;br /&gt;
    $sql=&amp;quot;KILL $process_id&amp;quot;;&lt;br /&gt;
    mysql_query($sql);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MySQL Server Administration ==&lt;br /&gt;
&lt;br /&gt;
=== MySQL Server Configuration File ===&lt;br /&gt;
&lt;br /&gt;
You can find it by typing:&lt;br /&gt;
 find -name my.cnf&lt;br /&gt;
&lt;br /&gt;
It can locate e.g. in:&lt;br /&gt;
 /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Enable MySQL Server Slow Query Log ====&lt;br /&gt;
&lt;br /&gt;
MySQL has a feature that allows you to log slow running queries to a file. To enable you just need to add some lines to your my.cnf file, and restart. To log the queries taking longer than two seconds to the specified log file, add the following (or uncomment lines if exists):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
log-slow-queries = /var/log/mysql/mysql-slow.log&lt;br /&gt;
long_query_time = 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Backup Database ===&lt;br /&gt;
&lt;br /&gt;
* [[Mysqldump |Backup database using mysqldump tool]]&lt;br /&gt;
* [[SQL#Backup_database_using_phpMyAdmin_web_ui |Backup database using phpMyAdmin web ui ]]&lt;br /&gt;
&lt;br /&gt;
=== Restore Database ===&lt;br /&gt;
&lt;br /&gt;
* [[SQL#Restore_Database]]&lt;br /&gt;
&lt;br /&gt;
== MySQL Server Logs ==&lt;br /&gt;
&lt;br /&gt;
Located e.g. in /var/www/drupal/ (files: mysql.log, mysql-slow.log)&lt;br /&gt;
* http://dev.mysql.com/doc/refman/5.1/en/server-logs.html&lt;br /&gt;
&lt;br /&gt;
== MySQL Server Tips ==&lt;br /&gt;
&lt;br /&gt;
=== Check MySQL Server Version ===&lt;br /&gt;
&lt;br /&gt;
 mysql --version&lt;br /&gt;
 // prints e.g. mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486) using  EditLine wrapper&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== If MySQL Server is stuck and website using it is down ===&lt;br /&gt;
&lt;br /&gt;
* Click Server/Palvelin --&amp;gt; Processes/Prosessit&lt;br /&gt;
* Choose Kill/Lopeta for processes which are stuck&lt;br /&gt;
* (You can see processes also from (but can't kill them): Check ongoing queries/locks from processlist (Database: information_schema - Table: PROCESSLIST) e.g. with phpMyAdmin)&lt;br /&gt;
* If there's a lot of locked queries for certain table (e.g. phpbb_sessions) you could try to change table type e.g. from MyISAM to InnoDB&lt;br /&gt;
* If there's a lot of queries which are increasing, you can stop your webserver to prevent generating more queries&lt;br /&gt;
* Restart MySQL server if there's something wrong with the queries&lt;br /&gt;
&lt;br /&gt;
==== Kill MySQL Processes ====&lt;br /&gt;
&lt;br /&gt;
Besides phpMyAdmin, you can kill processes by typing:&lt;br /&gt;
 KILL thread_id&lt;br /&gt;
&lt;br /&gt;
* Check: [[MySQL_Server#Kill_Stuck_Processes]]&lt;br /&gt;
* More information from: http://dev.mysql.com/doc/refman/5.1/en/kill.html&lt;br /&gt;
&lt;br /&gt;
=== MyISAM vs. InnoDB ===&lt;br /&gt;
&lt;br /&gt;
Claims for different database engines. Claims aren't surely facts.&lt;br /&gt;
&lt;br /&gt;
==== MyISAM ====&lt;br /&gt;
&lt;br /&gt;
'''Pros'''&lt;br /&gt;
* Is faster for applications like phpbb&lt;br /&gt;
* Uses simpler structure thus takes less space and has better performance with simple queries&lt;br /&gt;
* Much faster for large text based primary keys&lt;br /&gt;
* You can use mysqlhotcopy which is faster than mysqldump&lt;br /&gt;
* MyISAM supports FULL-TEXT indexes while InnoDB does not&lt;br /&gt;
&lt;br /&gt;
'''Cons'''&lt;br /&gt;
* Supports only table locking&lt;br /&gt;
* No support for transactions&lt;br /&gt;
* No data integrity (e.g. relationship constraints) check, responsibility is left e.g. for database administrators and application developers.&lt;br /&gt;
&lt;br /&gt;
==== InnoDB ====&lt;br /&gt;
&lt;br /&gt;
'''Pros'''&lt;br /&gt;
* You can use inno hot backup, which don't lock the database during backup (writes ahead log). InnoDB Hot Backup has been renamed to MySQL Enterprise Backup, which is included as part of the MySQL Enterprise Edition.&lt;br /&gt;
* Supports row locking&lt;br /&gt;
* Give better performance results in inserting and updating data records&lt;br /&gt;
* Uses clustered indexes to reduce IO operations for PK access&lt;br /&gt;
* Has transactions while MyISAM does not&lt;br /&gt;
* Has better crash recovery&lt;br /&gt;
* (InnoDB is newer while MyISAM is older)&lt;br /&gt;
&lt;br /&gt;
'''Cons'''&lt;br /&gt;
* No FULL-TEXT support&lt;br /&gt;
* Consumes more system resources such as RAM. As a matter of fact, it is recommended by many that InnoDB engine be turned off if there’s no substantial need for it after installation of MySQL.&lt;br /&gt;
&lt;br /&gt;
==== Conclusions ====&lt;br /&gt;
&lt;br /&gt;
* If your project is small and doesn't have any issues with DB leave MyISAM&lt;br /&gt;
* If you have write-heavy load (like community site, where users add many content items) choose InnoDB&lt;br /&gt;
&lt;br /&gt;
==== Change Table Engine From MyISAM to InnoDB And Vice Versa  ====&lt;br /&gt;
&lt;br /&gt;
To change a MyISAM table to an InnoDB table:&lt;br /&gt;
 ALTER TABLE table_name ENGINE = InnoDB;&lt;br /&gt;
&lt;br /&gt;
To convert an InnoDB table to a MyISAM table:&lt;br /&gt;
 ALTER TABLE table_name ENGINE = MyISAM;&lt;br /&gt;
&lt;br /&gt;
* Tip: When converting from MyISAM to InnoDB you can speed up the transformation. Before converting the table, adjust order so that the primary key column is in order:&lt;br /&gt;
 ALTER TABLE tablename ORDER BY 'primary_key_column';&lt;br /&gt;
&lt;br /&gt;
* This will pre-arrange the table so that it can be converted quickly without a lot of re-arranging required in MySQL. Then, simply change the table engine:&lt;br /&gt;
 ALTER TABLE tablename ENGINE = INNODB;&lt;br /&gt;
&lt;br /&gt;
== MySQL Tips ==&lt;br /&gt;
&lt;br /&gt;
=== Select inside update query ===&lt;br /&gt;
&lt;br /&gt;
If you get following error message:&lt;br /&gt;
 #1093 - You can't specify target table 'gsmvalidation' for update in FROM clause&lt;br /&gt;
&lt;br /&gt;
When executing following query:&lt;br /&gt;
 UPDATE `gsmvalidation` SET confirmedtime = (SELECT NOW()) WHERE id = (SELECT id FROM `gsmvalidation` WHERE uid = 1 ORDER BY `codesended` DESC LIMIT 1)&lt;br /&gt;
&lt;br /&gt;
The reason is that in MySQL, you can't modify the same table which you use in the SELECT part. You have to make another subquery and give alias for table name.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
 UPDATE `gsmvalidation` SET confirmedtime = (SELECT NOW())&lt;br /&gt;
 WHERE id = (SELECT id FROM (SELECT id,uid,codesended from `gsmvalidation`) AS temp WHERE uid = 1 ORDER BY `codesended` DESC LIMIT 1)&lt;br /&gt;
&lt;br /&gt;
=== MySQL server has gone away error ===&lt;br /&gt;
&lt;br /&gt;
If you get the following error while restoring a big database:&lt;br /&gt;
 ERROR 2006 (HY000) at line ##: MySQL server has gone away&lt;br /&gt;
&lt;br /&gt;
..make sure that the value &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; is big enough in /etc/my.cnf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[mysqld]&lt;br /&gt;
max_allowed_packet=64M&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Restart MySQL server to apply changes. If you can't find the mysql config file, check [[Config_files | Config files page]]&lt;br /&gt;
&lt;br /&gt;
=== After Restoring Mysql Database Phpmyadmin Won't Show The Tables ===&lt;br /&gt;
&lt;br /&gt;
* Problem: I exported a production database and created a development database from the backup.  Now when I try to check the contents of the database from phpmyadmin, there's no tables in it. I can see the tables with &amp;lt;code&amp;gt;SHOW TABLES;&amp;lt;/code&amp;gt; command and from mysql command line but not from phpmyadmin.&lt;br /&gt;
&lt;br /&gt;
* Possible reason: The imported database has VIEW(S) defined by a user that don't exist in the new computer's mysql users.&lt;br /&gt;
&lt;br /&gt;
* Solution: Create a missing user or drop the view(s) and create them again with an existing user.&lt;br /&gt;
&lt;br /&gt;
* Case: Exporting and importing Drupal 6 database with Ubercart module&lt;br /&gt;
&lt;br /&gt;
Drupal 6 database includes 3 views when Uber Cart module is installed:&lt;br /&gt;
dr_uc_order_products_pair_vw, dr_uc_order_products_qty_vw, dr_uc_order_products_user_vw&lt;br /&gt;
&lt;br /&gt;
Check the information and creation script of the specific view&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SHOW CREATE VIEW dr_uc_order_products_pair_vw&lt;br /&gt;
Results:&lt;br /&gt;
View: dr_uc_order_products_pair_vw&lt;br /&gt;
Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`drupal`@`www.p... &lt;br /&gt;
character_set_client: utf8&lt;br /&gt;
collation_connection: utf8_general_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get the full &amp;quot;Create view&amp;quot; code, click &amp;quot;Print view (with full texts)&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE ALGORITHM=UNDEFINED DEFINER=`drupal`@`www.yoursite.com` SQL SECURITY DEFINER VIEW `dr_uc_order_products_pair_vw` AS select `op1`.`nid` AS `nid`,`op2`.`nid` AS `pair_nid`,sum(`op2`.`qty`) AS `pair_sum_qty`,count(`op2`.`nid`) AS `order_count` from (`dr_uc_order_products` `op1` join `dr_uc_order_products` `op2`) where ((`op1`.`order_id` = `op2`.`order_id`) and (`op1`.`nid` &amp;lt;&amp;gt; `op2`.`nid`)) group by `op1`.`nid`,`op2`.`nid` order by `op1`.`nid`,count(`op2`.`nid`) desc,sum(`op2`.`qty`) desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you try to check the contents of the view:&lt;br /&gt;
 SELECT * FROM dr_uc_order_products_pair_vw&lt;br /&gt;
You'll get an error message:&lt;br /&gt;
 #1449 - The user specified as a definer ('drupal'@'www.yoursite.com') does not exist&lt;br /&gt;
&lt;br /&gt;
Now you can drop the views causing problem and recreate those with the right users:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DROP VIEW dr_uc_order_products_pair_vw;&lt;br /&gt;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dr_uc_order_products_pair_vw` AS select `op1`.`nid` AS `nid`,`op2`.`nid` AS `pair_nid`,sum(`op2`.`qty`) AS `pair_sum_qty`,count(`op2`.`nid`) AS `order_count` from (`dr_uc_order_products` `op1` join `dr_uc_order_products` `op2`) where ((`op1`.`order_id` = `op2`.`order_id`) and (`op1`.`nid` &amp;lt;&amp;gt; `op2`.`nid`)) group by `op1`.`nid`,`op2`.`nid` order by `op1`.`nid`,count(`op2`.`nid`) desc,sum(`op2`.`qty`) desc;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Views ==&lt;br /&gt;
&lt;br /&gt;
=== List Views ===&lt;br /&gt;
&lt;br /&gt;
Phpmyadmin shows different icon (eye) for views in table listing compared to normal tables.&lt;br /&gt;
You can get a list of all views in specific database with a sql query&lt;br /&gt;
 SHOW FULL TABLES IN database_name WHERE TABLE_TYPE LIKE 'VIEW';&lt;br /&gt;
&lt;br /&gt;
=== Check Views ===&lt;br /&gt;
&lt;br /&gt;
Shows the properties of a view and it's creation statement&lt;br /&gt;
 SHOW CREATE VIEW test_view&lt;br /&gt;
&lt;br /&gt;
=== Create Views ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test_view` AS select `test-table`.`id` AS `id`,`test-table`.`age` AS `age` from `test-table` 	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
..or from phpmyadmin, execute a sql query for wanted result set and click &amp;quot;Create View&amp;quot; link from bottom section of the page.&lt;br /&gt;
&lt;br /&gt;
=== Delete Views ===&lt;br /&gt;
&lt;br /&gt;
 DROP VIEW test_view&lt;br /&gt;
&lt;br /&gt;
=== Replace Views ===&lt;br /&gt;
&lt;br /&gt;
When creating a new view from phpmyadmin you can specify an existing name and check the &amp;quot;OR REPLACE&amp;quot; box.&lt;br /&gt;
&lt;br /&gt;
== Stored Procedures and Functions ==&lt;br /&gt;
&lt;br /&gt;
Since MySQL version 5.0 there have been a support for stored procedures, triggers and events. Stored procedures are saved in mysql database's proc table.&lt;br /&gt;
* http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx&lt;br /&gt;
&lt;br /&gt;
=== Create a Stored Procedure ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DELIMITER //&lt;br /&gt;
CREATE PROCEDURE GetAllArticles()&lt;br /&gt;
  BEGIN&lt;br /&gt;
  SELECT * FROM articles;&lt;br /&gt;
  END //&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Call the Stored Procedure ===&lt;br /&gt;
&lt;br /&gt;
 CALL DatabaseName.StroredPrecedureName();&lt;br /&gt;
&lt;br /&gt;
=== Alter a Stored Procedure ===&lt;br /&gt;
&lt;br /&gt;
Note! With the ALTER PROCEDURE Statement you can change only the characteristics and if you want to change in statement list then you have to DROP the procedure and CREATE again.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ALTER {PROCEDURE | FUNCTION} {proc_name | func_name} [characteristic ...]&lt;br /&gt;
  characteristic: SQL SECURITY {DEFINER | INVOKER}| COMMENT 'string'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drop a Stored Procedure ===&lt;br /&gt;
&lt;br /&gt;
 DROP PROCEDURE IF EXISTS exampleSproc;&lt;br /&gt;
&lt;br /&gt;
=== Variables in Sprocs ===&lt;br /&gt;
&lt;br /&gt;
* Save count of articles into a variable and print it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DELIMITER //&lt;br /&gt;
CREATE PROCEDURE HowMany()&lt;br /&gt;
  BEGIN&lt;br /&gt;
  DECLARE articlecount INT DEFAULT 0;&lt;br /&gt;
  SELECT COUNT(*) INTO articlecount FROM articles;&lt;br /&gt;
  SELECT articlecount;&lt;br /&gt;
  END //&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DELIMITER //&lt;br /&gt;
CREATE PROCEDURE HowMany()&lt;br /&gt;
  BEGIN&lt;br /&gt;
  DECLARE articlecount INT DEFAULT 0;&lt;br /&gt;
  SET articlecount = 33;&lt;br /&gt;
  SELECT CONCAT('Article count: ',articlecount) AS 'End Result';&lt;br /&gt;
  END //&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameters in Sprocs ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
CREATE PROCEDURE testdatabase.ShowArticles(IN emails VARCHAR(255))&lt;br /&gt;
  BEGIN&lt;br /&gt;
  SELECT * FROM users WHERE email IN (emails);&lt;br /&gt;
  END $$&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* http://www.mysqltutorial.org/stored-procedures-parameters.aspx&lt;br /&gt;
&lt;br /&gt;
=== Misc Sprocs ===&lt;br /&gt;
&lt;br /&gt;
==== Remove Emails Sproc ====&lt;br /&gt;
&lt;br /&gt;
Stored procedure which removes wanted email addresses from newsletter tables&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DELIMITER //&lt;br /&gt;
DROP PROCEDURE IF EXISTS drupal6.removeSubscribers//&lt;br /&gt;
CREATE PROCEDURE drupal6.removeSubscribers(IN emailsToRemove VARCHAR(2000))&lt;br /&gt;
  BEGIN&lt;br /&gt;
   SELECT REPLACE(emailsToRemove,' ','') INTO emailsToRemove;&lt;br /&gt;
   SELECT REPLACE(emailsToRemove,',','\',\'') INTO emailsToRemove;&lt;br /&gt;
   SELECT CONCAT('\'', emailsToRemove, '\'') INTO emailsToRemove;&lt;br /&gt;
   SET @sql1 = CONCAT('DELETE FROM simplenews_snid_tid WHERE snid IN (SELECT snid FROM simplenews_subscriptions WHERE mail IN (', emailsToRemove, ')) LIMIT 200');&lt;br /&gt;
   SET @sql2 = CONCAT('DELETE FROM simplenews_subscriptions WHERE mail IN (', emailsToRemove, ') LIMIT 200');&lt;br /&gt;
   PREPARE stmt1 FROM @sql1;&lt;br /&gt;
   PREPARE stmt2 FROM @sql2;&lt;br /&gt;
   EXECUTE stmt1;&lt;br /&gt;
   EXECUTE stmt2;&lt;br /&gt;
   SELECT CONCAT('Email addresses removed: ',ROW_COUNT()) AS 'Affected Rows';&lt;br /&gt;
   DEALLOCATE PREPARE stmt1;&lt;br /&gt;
   DEALLOCATE PREPARE stmt2;&lt;br /&gt;
   #SELECT @sql1;&lt;br /&gt;
  END //&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example call:&lt;br /&gt;
 CALL drupal6.removeSubscribers('email1@yahoo.com,email2@hotmail.com, email3@google.com');&lt;br /&gt;
&lt;br /&gt;
== MySQL Datatypes ==&lt;br /&gt;
&lt;br /&gt;
=== Text Types ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CHAR( )	A fixed section from 0 to 255 characters long.&lt;br /&gt;
VARCHAR( )	A variable section from 0 to 255 characters long, e.g. VARCHAR(20)&lt;br /&gt;
TINYTEXT	A string with a maximum length of 255 characters.&lt;br /&gt;
TEXT		A string with a maximum length of 65535 characters.&lt;br /&gt;
BLOB		A string with a maximum length of 65535 characters.&lt;br /&gt;
MEDIUMTEXT	A string with a maximum length of 16777215 characters.&lt;br /&gt;
MEDIUMBLOB	A string with a maximum length of 16777215 characters.&lt;br /&gt;
LONGTEXT	A string with a maximum length of 4294967295 characters.&lt;br /&gt;
LONGBLOB	A string with a maximum length of 4294967295 characters.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number Types ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TINYINT( )	-128 to 127 normal&lt;br /&gt;
		0 to 255 UNSIGNED.&lt;br /&gt;
TINYINT(1)	Boolean. 0 is FALSE and others TRUE.&lt;br /&gt;
SMALLINT( )	-32768 to 32767 normal&lt;br /&gt;
		0 to 65535 UNSIGNED.&lt;br /&gt;
MEDIUMINT( )	-8388608 to 8388607 normal&lt;br /&gt;
		0 to 16777215 UNSIGNED.&lt;br /&gt;
INT( )		-2147483648 to 2147483647 normal&lt;br /&gt;
		0 to 4294967295 UNSIGNED.&lt;br /&gt;
BIGINT( )	-9223372036854775808 to 9223372036854775807 normal&lt;br /&gt;
		0 to 18446744073709551615 UNSIGNED.&lt;br /&gt;
FLOAT		A small number with a floating decimal point.&lt;br /&gt;
DOUBLE( , )	A large number with a floating decimal point.&lt;br /&gt;
DECIMAL( , )	A DOUBLE stored as a string , allowing for a fixed decimal point.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Serial ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SERIAL&amp;lt;/code&amp;gt; is an alias for &amp;lt;code&amp;gt;BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE&amp;lt;/code&amp;gt;. Good option e.g. for first ID-column.&lt;br /&gt;
&lt;br /&gt;
=== Date Types ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DATE		YYYY-MM-DD&lt;br /&gt;
DATETIME	YYYY-MM-DD HH:MM:SS&lt;br /&gt;
TIMESTAMP	e.g. YYYYMMDDHHMMSS (basicly same as datetime)&lt;br /&gt;
TIME		HH:MM:SS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Creator</name></author>
		
	</entry>
</feed>