<?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>LAMPdocs: Linux, Apache, MySQL, PHP &#187; MySQL Tricks</title>
	<atom:link href="http://www.lampdocs.com/blog/category/mysql-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lampdocs.com/blog</link>
	<description>Linux, Apache, MySQL, PHP: Docs, Tricks and Secrets</description>
	<lastBuildDate>Wed, 04 Jan 2012 13:11:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Add MySQL Root Password for Directadmin</title>
		<link>http://www.lampdocs.com/blog/2010/10/how-to-add-mysql-root-password-for-directadmin/</link>
		<comments>http://www.lampdocs.com/blog/2010/10/how-to-add-mysql-root-password-for-directadmin/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 09:39:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Directadmin Tricks]]></category>
		<category><![CDATA[MySQL Tricks]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[add root account mysql]]></category>
		<category><![CDATA[mysql root directadmin]]></category>
		<category><![CDATA[mysql root grant privileges]]></category>

		<guid isPermaLink="false">http://www.lampdocs.com/blog/?p=594</guid>
		<description><![CDATA[How to add root account for mysql]]></description>
			<content:encoded><![CDATA[<p>Recently I had to deal with a Directadmin VPS that had mysql installed, but for some reason there wasn&#8217;t a record for root in mysql user table. Here are the queries I used to add a root account, and to assign all the necessary privilegies. </p>
<p>First of all We need to create a record with username and password. </p>
<blockquote><p>INSERT INTO user(user, password) values (&#8216;root&#8217;, PASSWORD(&#8216;PASSWORD_HERE&#8217;));</p></blockquote>
<p>Then we need to add all the privileges to our root: </p>
<blockquote><p>UPDATE `mysql`.`user` SET `Select_priv` = &#8216;Y&#8217;,<br />
`Insert_priv` = &#8216;Y&#8217;,<br />
`Update_priv` = &#8216;Y&#8217;,<br />
`Delete_priv` = &#8216;Y&#8217;,<br />
`Create_priv` = &#8216;Y&#8217;,<br />
`Drop_priv` = &#8216;Y&#8217;,<br />
`Reload_priv` = &#8216;Y&#8217;,<br />
`Shutdown_priv` = &#8216;Y&#8217;,<br />
`Process_priv` = &#8216;Y&#8217;,<br />
`File_priv` = &#8216;Y&#8217;,<br />
`Grant_priv` = &#8216;Y&#8217;,<br />
`References_priv` = &#8216;Y&#8217;,<br />
`Index_priv` = &#8216;Y&#8217;,<br />
`Alter_priv` = &#8216;Y&#8217;,<br />
`Show_db_priv` = &#8216;Y&#8217;,<br />
`Super_priv` = &#8216;Y&#8217;,<br />
`Create_tmp_table_priv` = &#8216;Y&#8217;,<br />
`Lock_tables_priv` = &#8216;Y&#8217;,<br />
`Execute_priv` = &#8216;Y&#8217;,<br />
`Repl_slave_priv` = &#8216;Y&#8217;,<br />
`Repl_client_priv` = &#8216;Y&#8217;,<br />
`Create_view_priv` = &#8216;Y&#8217;,<br />
`Show_view_priv` = &#8216;Y&#8217;,<br />
`Create_routine_priv` = &#8216;Y&#8217;,<br />
`Alter_routine_priv` = &#8216;Y&#8217;,<br />
`Create_user_priv` = &#8216;Y&#8217; WHERE `user`.`Host` = &#8221; AND `user`.`User` = &#8216;root&#8217; LIMIT 1 ;</p></blockquote>
<p>And the last command: </p>
<blockquote><p>GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY &#8216;PASSWORD_HERE&#8217; WITH GRANT OPTION </p></blockquote>
<p>Then you can do the same for da_admin mysql user: </p>
<blockquote><p>GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY &#8216;PASSWORD_HERE&#8217; WITH GRANT OPTION;</p></blockquote>
<p>Restart mysql and have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lampdocs.com/blog/2010/10/how-to-add-mysql-root-password-for-directadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Improve MySQL Performance with a Single Line in Config</title>
		<link>http://www.lampdocs.com/blog/2008/10/how-to-improve-mysql-performance-with-a-single-line-in-config/</link>
		<comments>http://www.lampdocs.com/blog/2008/10/how-to-improve-mysql-performance-with-a-single-line-in-config/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 14:54:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL Tricks]]></category>
		<category><![CDATA[improve mysql configuration]]></category>
		<category><![CDATA[improve mysql on heavy servers]]></category>
		<category><![CDATA[max_write_lock_count = 1]]></category>
		<category><![CDATA[mysql max_write_lock_count]]></category>
		<category><![CDATA[mysql performance]]></category>

		<guid isPermaLink="false">http://www.lampdocs.com/blog/?p=228</guid>
		<description><![CDATA[I have found a way to prevent server overload because of MySQL. The tip seems to be really good, and I am giving the link to the original post. Here it is: Dramatically Improve MySQL Performance In order to make your heavy MySQL servers perform faster all you need is to add a line to [...]]]></description>
			<content:encoded><![CDATA[<p>I have found a way to prevent server overload because of MySQL. The tip seems to be really good, and I am giving the link to the original post. Here it is: <a href="http://blog.taragana.com/index.php/archive/one-mysql-configuration-tip-that-can-dramatically-improve-mysql-performance/">Dramatically Improve MySQL Performance</a></p>
<p>In order to make your heavy MySQL servers perform faster all you need is to add a line to your MySQL configuration file: my.cnf.</p>
<blockquote><p><a href="http://www.lampdocs.com/blog/tag/max_write_lock_count-1/" class="st_tag internal_tag" rel="tag" title="Posts tagged with max_write_lock_count = 1">max_write_lock_count = 1</a></p></blockquote>
<p>This line should be added under [mysqld] section of <strong>my.cnf</strong>. I won&#8217;t describe what does this setting actually do as you&#8217;re welcome to read it in the original post. I just want to say that this little string greatly increases your MySQL server performance. You&#8217;re welcome to try and to get back in your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lampdocs.com/blog/2008/10/how-to-improve-mysql-performance-with-a-single-line-in-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Optimize Your LAMP Configuration</title>
		<link>http://www.lampdocs.com/blog/2008/09/how-to-optimize-your-lamp-configuration/</link>
		<comments>http://www.lampdocs.com/blog/2008/09/how-to-optimize-your-lamp-configuration/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 07:49:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache Performance]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[MySQL Tricks]]></category>
		<category><![CDATA[PHP Configuration]]></category>
		<category><![CDATA[fine tune apache]]></category>
		<category><![CDATA[LAMP config]]></category>

		<guid isPermaLink="false">http://www.lampdocs.com/blog/?p=155</guid>
		<description><![CDATA[Today I&#8217;m just sharing a link: I don&#8217;t think I can explain this better than IBM guys did. These three acrticles contain a comprehensive guide for your LAMP system optimization. Here is the first one, that contains general linux settings for perfect LAMP config. The second one describes how to fine tune Apache and PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m just sharing a link: I don&#8217;t think I can explain this better than IBM guys did. These three acrticles contain a comprehensive guide for your LAMP system optimization. Here is the first one, that contains <a href="http://www.ibm.com/developerworks/linux/library/l-tune-lamp-1/index.html?S_TACT=105AGX03&amp;S_CMP=EDU">general linux settings for perfect LAMP config</a>. The second one describes <a href="http://www.ibm.com/developerworks/linux/library/l-tune-lamp-2.html?S_TACT=105AGX03&amp;S_CMP=EDU">how to fine tune Apache and PHP </a>and finally the third one deals with MySQL &#8211; you will find out <a href="http://www.ibm.com/developerworks/linux/library/l-tune-lamp-3.html?S_TACT=105AGX03&amp;S_CMP=EDU">how to optimize MySQL configuration for any server</a> . I usually recommend this guide for those who didn&#8217;t tune anything before &#8211; it&#8217;s clear and brings excellent results. If you have links to similar excellent tutorials, you&#8217;re welcome to share them in comments. Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lampdocs.com/blog/2008/09/how-to-optimize-your-lamp-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Restore a MySQL Database with Linux Shell</title>
		<link>http://www.lampdocs.com/blog/2008/07/restoring-a-mysql-database-from-backup-with-linux-shell/</link>
		<comments>http://www.lampdocs.com/blog/2008/07/restoring-a-mysql-database-from-backup-with-linux-shell/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 12:03:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[MySQL Tricks]]></category>
		<category><![CDATA[mysql database restore linux]]></category>
		<category><![CDATA[mysql restore big database]]></category>
		<category><![CDATA[mysql restore shell]]></category>
		<category><![CDATA[mysql shell command to restore database]]></category>
		<category><![CDATA[restore database from dump linux]]></category>
		<category><![CDATA[restore mysql database ssh]]></category>
		<category><![CDATA[Winscp: How to Prevent Timeouts]]></category>

		<guid isPermaLink="false">http://www.lampdocs.com/blog/?p=98</guid>
		<description><![CDATA[Today I will show a simple command that will allow you to restore a database from a previously made sql file. No matter, how the backup was done, if it has sql commands, you will restore it in the fastest possible way. If your database backup file exceeds 10 megabytes, it&#8217;ll be very hard to [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will show a simple command that will allow you to restore a database from a previously made sql file. No matter, how the backup was done, if it has sql commands, you will restore it in the fastest possible way.</p>
<p>If your database backup file exceeds 10 megabytes, it&#8217;ll be very hard to restore it using usual panel options (I mean Directadmin, Cpanel, PhpMyAdmin, etc). If you have shell a access to your server, you may significally decrease the time necessary for backup restore. All you have to do id to upload this backup to an accessible location, and then to run a command:</p>
<p>mysql -p<strong>password </strong>-u <strong>user database_name</strong> -h <strong>localhost</strong> &lt; <strong>path_to_sql_file</strong></p>
<p>This command will start mysql database restore ptocess without prompting for a password. If you want to enter your password each time, you should leave -p option empty.</p>
<p>This is the fastest way to recreate your database using a dump file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lampdocs.com/blog/2008/07/restoring-a-mysql-database-from-backup-with-linux-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Error 28 &#8211; How to Fix it</title>
		<link>http://www.lampdocs.com/blog/2008/06/mysql-error-28-how-to-fix-it/</link>
		<comments>http://www.lampdocs.com/blog/2008/06/mysql-error-28-how-to-fix-it/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 12:27:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[MySQL Tricks]]></category>
		<category><![CDATA[mysql error 28]]></category>
		<category><![CDATA[no space left on device mysql]]></category>

		<guid isPermaLink="false">http://www.lampdocs.com/blog/?p=75</guid>
		<description><![CDATA[Today when I tried to perform some MySQL tasks and got error 28. After several searches I found that this error means that no free space is left on server HDD. When I ran df command, I was very surprised, but my disk usage was 100% &#8211; so much that MySQL couldn&#8217;t even create a [...]]]></description>
			<content:encoded><![CDATA[<p>Today when I tried to perform some MySQL tasks and got error 28. After several searches I found that this error means that no free space is left on server HDD. When I ran df command, I was very surprised, but my disk usage was 100% &#8211; so much that MySQL couldn&#8217;t even create a log file. It&#8217;s a strange thing I didn&#8217;t notice this before. I had to check MySQL when my blog&#8217;s categories have disappeared. I highly recommend to enable DirectAdmin disk usage warning as I eventually missed disk overuse on my VPS.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lampdocs.com/blog/2008/06/mysql-error-28-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Repair And Optimize All Mysql Databases</title>
		<link>http://www.lampdocs.com/blog/2008/05/how-to-repair-and-optimize-all-mysql-databases/</link>
		<comments>http://www.lampdocs.com/blog/2008/05/how-to-repair-and-optimize-all-mysql-databases/#comments</comments>
		<pubDate>Thu, 15 May 2008 09:37:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Directadmin Tricks]]></category>
		<category><![CDATA[MySQL Tricks]]></category>
		<category><![CDATA[backup all databases mysql]]></category>
		<category><![CDATA[directadmin mysql backup]]></category>
		<category><![CDATA[mysql database check]]></category>
		<category><![CDATA[repair all databases mysql]]></category>

		<guid isPermaLink="false">http://www.lampdocs.com/blog/?p=63</guid>
		<description><![CDATA[When I tried to create admin backup for DirectAdmin, I got the message that one of my MySQL databases has errors and these errors were propagated to my backup. I&#8217;d suggest this to DirectAdmin developers, as using a simple command should avoid such errors. There is a linux shell tool called mysqlcheck, that allows to [...]]]></description>
			<content:encoded><![CDATA[<p>When I tried to create admin backup for DirectAdmin, I got the message that one of my MySQL databases has errors and these errors were propagated to my backup. I&#8217;d suggest this to DirectAdmin developers, as using a simple command should avoid such errors. There is a linux shell tool called mysqlcheck, that allows to check, repair and optimize mysql databases without stopping mysqld. I will show you its usage so you can run this command before creating any kind of backups.</p>
<p><strong>mysqlcheck -uroot -ppass -Aor</strong></p>
<p>Male sure to include MySQL root password for this operation. If you don&#8217;t know your root password, check <a href="http://help.directadmin.com/item.php?id=45">DirectAdmin Help </a> for information regarding it. Let&#8217;s describe used options in brief. <strong>-A </strong>tells us that all databases will be checked. <strong>-r</strong> &#8211; Repairs selected databases, <strong>-o</strong> &#8211; Optimizes selected databases. This simple operation will allow you to have only good databases in your backups. You may also add this operation to your root crontab to keep your databases optimized.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lampdocs.com/blog/2008/05/how-to-repair-and-optimize-all-mysql-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

