<?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>Brilang.com &#187; mysql</title>
	<atom:link href="http://www.brilang.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brilang.com</link>
	<description></description>
	<lastBuildDate>Fri, 23 Jul 2010 01:16:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reset the Root Password on MySQL</title>
		<link>http://www.brilang.com/2008/08/11/reset-the-root-password-on-mysql/</link>
		<comments>http://www.brilang.com/2008/08/11/reset-the-root-password-on-mysql/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 22:17:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.brianlang.ca/?p=198</guid>
		<description><![CDATA[From time to time, you may run across a MySQL database where you don&#8217;t have the root password, but you require it to perform some task or another. In my case, I inherited a MySQL installation but no root password was available. The root password in the records did not work. Here&#8217;s a quick lesson [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mysql.com/common/logos/logo_mysql_sun_a.gif" width="114" height="68" style="float: left; margin: 0 10px 10px 0" />From time to time, you may run across a MySQL database where you don&#8217;t have the root password, but you require it to perform some task or another. In my case, I inherited a MySQL installation but no root password was available. The root password in the records did not work. Here&#8217;s a quick lesson in resetting the root password.<br />
<span id="more-198"></span><br />
NOTE: This only works of you have command line access to your MySQL installation. This is a multi-step process. All steps must be completed to properly re-secure your database.</p>
<ol>
<li>Stop the MySQL process: <code>sudo /etc/init.d/mysql stop</code></li>
<li>Start the MySQL process in safe mode: <code>sudo mysqld_safe --skip-grant-tables &#038;</code></li>
<li>Connect to the MySQL server (no password required): <code>mysql -u root</code></li>
<li>Tell MySQL to use the mysql database: <code>USE mysql;</code></li>
<li>Run this UPDATE query: <code>UPDATE user SET password = PASSWORD("new_root_password") WHERE user='root';</code></li>
<li>Flush the database Privileges: <code>flush privileges;</code></li>
<li>Exit MySQL: <code>quit</code></li>
<li>Stop the MySQL Server from running in safe mode: <code>sudo /etc/init.d/mysql stop</code></li>
<li>Restart MySQL in normal mode: <code>sudo /etc/init.d/mysql start</code></li>
<li>Try to log in with the new root password: <code>mysql -u root -p</code></li>
</ol>
<p>If the goal of the exercise is simply to dump the data, you can stop after completing step 3 and run your favorite <code>mysqldump</code> command. Then you can import it into a new MySQL instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brilang.com/2008/08/11/reset-the-root-password-on-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
