Schema.pro

MySql reset root password

04.10 2018|MySQL

Reset forgotten password for MySQL

Stop daemon MySQL:
/etc/init.d/mysql stop

Start MySQL daemon without checking grants:
/usr/bin/mysqld_safe --skip-grant-tables &

Enter as root without password :
mysql --user=root mysql

Create new password:
mysql> update user set Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
mysql> flush privileges;

Stop mysqld_safe any way you know:
For example, kill -9 :-)

And start MySQL as usually:
/etc/init.d/mysql start


Simple reset password for root in MySQL
Programming, coding, system administration linux

 2 
  Comment
YouTube video
Add image
OK