Platinum Partner
java,sql,mysql,shell,root access

Reset MySQL Root Password On Linux

 

 Five easy steps to reset MySQL root password.

  1. Stop the MySQL server.
  2. Start the MySQL server with the --skip-grant-tables option. (it will not prompt for password)
  3. Connect to MySQL server as the root user. 
  4. Setup new MySQL root password.
  5. Exit and restart the MySQL server. 

    
### Shell Commands ###
/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables & 
mysql -u root

### SQL Commands ###
use mysql;
UPDATE user SET password=PASSWORD("new-password") WHERE user='root';
flush privileges;
exit

### Shell Commands ###
/etc/init.d/mysql stop
/etc/init.d/mysql start
mysql -u root -pnew-password  
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}