To change the MySQL root password, run the below commands as root:
Connect to mysql with the following command:
Execute the below command in the mysql client:
The 'newpwd' will be the new password for the MySQL.
/etc/init.d/mysql stop
killall -9 mysql
/etc/init.d/mysql --skip-grant-tables --user=root start
Connect to mysql with the following command:
mysql -u root
Execute the below command in the mysql client:
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
The 'newpwd' will be the new password for the MySQL.
0 comments:
Post a Comment