Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can recover MySQL database server password with following five easy steps.</p> <p><strong>Step # 1</strong>: Stop the MySQL server process.</p> <p><strong>Step # 2</strong>: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.</p> <p><strong>Step # 3</strong>: Connect to mysql server as the root user.</p> <p><strong>Step # 4</strong>: Setup new mysql root account password i.e. reset mysql password.</p> <p><strong>Step # 5</strong>: Exit and restart the MySQL server.</p> <p>Here are commands you need to type for each step (login as the root user):</p> <p><strong>Step # 1</strong> : Stop mysql service</p> <pre><code># /etc/init.d/mysql stop </code></pre> <p>Output:</p> <pre><code>Stopping MySQL database server: mysqld. </code></pre> <p><strong>Step # 2</strong>: Start to MySQL server w/o password:</p> <pre><code># mysqld_safe --skip-grant-tables &amp; </code></pre> <p>Output:</p> <pre><code>[1] 5988 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6025]: started </code></pre> <p><strong>Step # 3</strong>: Connect to mysql server using mysql client:</p> <pre><code># mysql -u root </code></pre> <p>Output:</p> <pre><code>Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql&gt; </code></pre> <p><strong>Step # 4</strong>: Setup new MySQL root user password</p> <pre><code>mysql&gt; use mysql; mysql&gt; update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; mysql&gt; flush privileges; mysql&gt; quit </code></pre> <p><strong>Step # 5</strong>: Stop MySQL Server:</p> <pre><code># /etc/init.d/mysql stop </code></pre> <p>Output:</p> <pre><code>Stopping MySQL database server: mysqld STOPPING server from pid file /var/run/mysqld/mysqld.pid mysqld_safe[6186]: ended [1]+ Done mysqld_safe --skip-grant-tables </code></pre> <p><strong>Step # 6</strong>: Start MySQL server and test it</p> <pre><code># /etc/init.d/mysql start # mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) # mysql -u root -p </code></pre> <p>Source: <a href="http://www.cyberciti.biz/tips/recover-mysql-root-password.html" rel="nofollow noreferrer">http://www.cyberciti.biz/tips/recover-mysql-root-password.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload