<?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>Andrew Beaton :: FAQ &#187; password reset</title>
	<atom:link href="http://andrewbeaton.net/faq/tag/password-reset/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewbeaton.net/faq</link>
	<description>Tips from the world of a software developer</description>
	<lastBuildDate>Wed, 10 Mar 2010 21:03:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Recover MySQL password</title>
		<link>http://andrewbeaton.net/faq/2009/11/13/recover-mysql-password/</link>
		<comments>http://andrewbeaton.net/faq/2009/11/13/recover-mysql-password/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:52:07 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[password reset]]></category>

		<guid isPermaLink="false">http://andrewbeaton.com/faq/?p=21</guid>
		<description><![CDATA[You can recover MySQL database server password with following five easy steps.
Here are commands you need to type for each step (login as the root user):

Stop mysql service
Start to MySQL server w/o password:
Connect to mysql server using mysql client:
Setup new MySQL root user password
Stop MySQL Server:
Start MySQL server and test it

Step # 1 : Stop [...]]]></description>
			<content:encoded><![CDATA[<p>You can recover MySQL database server password with following five easy steps.</p>
<p>Here are commands you need to type for each step (login as the root user):</p>
<ol>
<li>Stop mysql service</li>
<li>Start to MySQL server w/o password:</li>
<li>Connect to mysql server using mysql client:</li>
<li>Setup new MySQL root user password</li>
<li>Stop MySQL Server:</li>
<li>Start MySQL server and test it</li>
</ol>
<p><strong>Step # 1 : Stop mysql service</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/mysql stop</span></pre></div></div>

<p><em>Output:</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Stopping MySQL database server: mysqld.</pre></div></div>

<p><strong>Step # 2: Start to MySQL server w/o password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mysqld_safe --skip-grant-tables &amp;</span></pre></div></div>

<p><em>Output:</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000;">1058</span>
Starting mysqld daemon with databases from <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql
mysqld_safe<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">6025</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: started</pre></div></div>

<p><strong>Step # 3: Connect to mysql server using mysql client:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mysql -u root</span></pre></div></div>

<p><em>Output:</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection <span style="color: #c20cb9; font-weight: bold;">id</span> is <span style="color: #000000;">1</span> to server version: 4.1.15-Debian_1-log
&nbsp;
Type <span style="color: #ff0000;">'help;'</span> or <span style="color: #ff0000;">'\h'</span> <span style="color: #000000; font-weight: bold;">for</span> help. Type <span style="color: #ff0000;">'\c'</span> to <span style="color: #c20cb9; font-weight: bold;">clear</span> the buffer.
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p><strong> Step # 4: Setup new MySQL root user password</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">use</span> mysql<span style="color: #000033;">;</span>
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">update</span> <span style="color: #000099;">user</span> <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #000099;">password</span><span style="color: #CC0099;">=</span><span style="color: #000099;">PASSWORD</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">&quot;NEW-ROOT-PASSWORD&quot;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">where</span> <span style="color: #000099;">User</span><span style="color: #CC0099;">=</span><span style="color: #008000;">'root'</span><span style="color: #000033;">;</span>
mysql<span style="color: #CC0099;">&gt;</span> flush <span style="color: #990099; font-weight: bold;">privileges</span><span style="color: #000033;">;</span>
mysql<span style="color: #CC0099;">&gt;</span> quit</pre></div></div>

<p><strong>Step # 5: Stop MySQL Server:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/mysql stop</span></pre></div></div>

<p><em>Output:</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Stopping MySQL database server: mysqld
STOPPING server from pid <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysqld<span style="color: #000000; font-weight: bold;">/</span>mysqld.pid
mysqld_safe<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">6186</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: ended
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>+  Done                    mysqld_safe <span style="color: #660033;">--skip-grant-tables</span></pre></div></div>

<p><strong>Step # 6: Start MySQL server and test it</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/mysql start</span>
<span style="color: #666666; font-style: italic;"># mysql -u root -p</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://andrewbeaton.net/faq/2009/11/13/recover-mysql-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
