Resetting Mysql Root Password

  1. Kill the running mysql process
    1. sudo service mysql stop
  2. Start mysql in safe mode and skip grant tables
    1. sudo mysqld_safe --skip-grant-tables --skip-networking &
  3. Log in with root
    1. mysql -u root
  4. Initial privilege flush
    1. flush privileges;
  5. Use mysql database
    1. use mysql;
  6. Set a new mysql root password
    1. update user set authentication_string=PASSWORD("newPassword") where user='root';
  7.  Final privilege flush
    1. flush privileges;
  8. Exit mysql
    1. exit;
  9. Stop mysql service
    1. sudo /etc/init.d/mysql stop
  10. Start mysql service
    1. sudo /etc/init.d/mysql start
  11. Log in to database to test it
    1. mysql -u root -p

Comments

Popular posts from this blog

Intro to OpenFlow Tutorial with Ryu Controller

Snap Assists on Ubuntu 16