<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Change on Details...</title>
    <link>https://www.deepreflect.net/tags/change/</link>
    <description>Recent content in Change on Details...</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Copyright © 2003 - 2026 Leonardo Rizzi</copyright>
    <lastBuildDate>Tue, 30 Jun 2026 03:28:29 +0200</lastBuildDate>
    <atom:link href="https://www.deepreflect.net/tags/change/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>MySQL Change Password</title>
      <link>https://www.deepreflect.net/2009/03/22/mysql-change-password/</link>
      <pubDate>Sun, 22 Mar 2009 23:44:10 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=411</guid> 
      <description>&lt;p&gt;If you have never set a root password for mysql, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# mysqladmin -u root password NEWPASSWORD&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;However, if you want to change (or update) a root password, then you need to use following command&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# mysqladmin -u root -p oldpassword newpass&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Enter password:
Change MySQL password for other user
To change a normal user password you need to type (let us assume you would like to change password for leo):&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>If you have never set a root password for mysql, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:</p>
<p><code># mysqladmin -u root password NEWPASSWORD</code></p>
<p>However, if you want to change (or update) a root password, then you need to use following command</p>
<p><code># mysqladmin -u root -p oldpassword newpass</code></p>
<p>Enter password:
Change MySQL password for other user
To change a normal user password you need to type (let us assume you would like to change password for leo):</p>
<p><code># mysqladmin -u leo -p oldpassword newpass</code></p>
<p>Changing mysql root user password using mysql sql command
This is another method. mysql stores username and passwords in user table inside mysql database. You can directly update password using the following method to update or change password for user leo:</p>
<ol>
<li>Login to mysql server, type following command at shell prompt:</li>
</ol>
<p><code># mysql -u root -p</code></p>
<ol start="2">
<li>Use mysql database (type command at mysqlprompt):</li>
</ol>
<p><code>mysqluse mysql;</code></p>
<ol start="3">
<li>Change password for user leo:</li>
</ol>
<p><code>mysqlupdate user set password=PASSWORD(&quot;NEWPASSWORD&quot;) where User='leo';</code></p>
<ol start="4">
<li>Reload privileges:</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>mysqlflush privileges;
</span></span><span style="display:flex;"><span>mysqlquit
</span></span></code></pre></div>]]></content:encoded>
    </item>
  </channel>
</rss>
