Friday, November 4, 2011

Resetting MySQL root Password [In case You forgot password]

[root ~]# mysqld_safe --skip-grant-tables
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
110416 12:11:00 mysqld ended

[root ~]# mysql


mysql>update user set Password=PASSWORD('new-password') where user='root';
mysql>flush privileges;
mysql>exit;

4 comments:

  1. before running above command run

    [root ~]#service mysqld stop
    [root ~]#mysqld_safe --skip-grant-tables

    open the server in a new session and open the mysql without the password

    and after that same as above

    ReplyDelete
  2. FOR MySQL SET root Password

    [root@localhost]# mysqladmin -u root password 'admin';

    ReplyDelete
  3. [root ~]#service mysqld stop
    [root ~]#mysqld_safe --skip-grant-tables

    open the server in a new session and open the mysql without the password

    AFTER

    mysql>update user set Password=PASSWORD('new-password') where user='root';
    mysql>flush privileges;
    mysql>exit;

    ReplyDelete
  4. How to set Root Password in MySQL? Contact to MySQL Technical Support

    Cognegic is world's driving remote foundation association bolster supplier whose point isn't simply given to strengthen yet offer help through submitted and experienced MySQL professionals. In any of the circumstance, on the off chance that you go up against particular hiccups concerning your MySQL, Cognegic dependably select the best database or MySQL experts who can comprehend your start and end issues with no point of thwarted expectation. We give MySQL Remote Support and MySQL Remote Service incalculable around the world, under their cash related course of action. Our lords are talented to reveal your establishment to framework and support to recuperation issues and give persuading and easy to use strengthen. Interface with us for any issue concerning MySQL.For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete