<?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>Beat Fluri&#039;s Blog &#187; MySQL</title>
	<atom:link href="http://fluri.computerscience.ch/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://fluri.computerscience.ch</link>
	<description>Just for the sake of it...</description>
	<lastBuildDate>Sat, 10 Jul 2010 20:09:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL root access with sudo</title>
		<link>http://fluri.computerscience.ch/2009/08/mysql-root-access-with-sudo/</link>
		<comments>http://fluri.computerscience.ch/2009/08/mysql-root-access-with-sudo/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 20:59:32 +0000</pubDate>
		<dc:creator>bfluri</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://fluri.computerscience.ch/?p=53</guid>
		<description><![CDATA[Normally, the system&#8217;s root user does not automatically have root access to the MySQL (mysql in short) databases on the system. However, sometimes we&#8217;d like to have root access on our mysql databases via sudo. This is possible when performing the following steps as root:

$ touch /root/.my.cnf
$ chmod 600 /root/.my.cnf
Put the following text into /root/.my.cnf:
[client]
password        [...]]]></description>
			<content:encoded><![CDATA[<p>Normally, the system&#8217;s root user does not automatically have root access to the <a href="http://www.mysql.com">MySQL</a> (mysql in short) databases on the system. However, sometimes we&#8217;d like to have root access on our mysql databases via <code>sudo</code>. This is possible when performing the following steps as root:</p>
<ol>
<li><code>$ touch /root/.my.cnf</code></li>
<li><code>$ chmod 600 /root/.my.cnf</code></li>
<li>Put the following text into /root/.my.cnf:
<pre>[client]
password        = &lt;mysql root password&gt;
port            = 3306
host            = localhost
socket          = path/to/your/mysql.sock</pre>
</li>
</ol>
<p>When having a <code>.my.cnf</code> file in the home-directory, executing <code>mysql</code> starts the mysql-client under the currently logged-in user and  by using the password provided in the <code>~/.my.cnf</code> file. This also means, that</p>
<pre>$ sudo -H mysql</pre>
<p>starts the mysql-client under mysql-&#8221;root.&#8221; The option &#8220;<code>-H</code>&#8221; is necessary because <code>sudo</code> has to change the home-directory to the system&#8217;s root user, <em>i.e.</em>, <code>/root/</code>. Otherwise, <code>mysql</code> uses the <code>~/.my.cnf</code> file of the user executing <code>sudo</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fluri.computerscience.ch/2009/08/mysql-root-access-with-sudo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
