Home >Database >Mysql Tutorial >lamp how to change mysql password
lampHow to change the mysql password: first stop the MySQL service; then start MySQL skipping verification; then change the password through the command "PASSWORD('new password') where USER='root';"; finally restart mysql is enough.
Recommendation: "mysql video tutorial"
1. Modify through commands, as follows:
a. Stop the MySQL service
Execute:/etc/init.d/mysql stop
b. Skip verification and start MySQL
/usr/local/mysql/bin/mysqld_safe –skip-grant-tables >/dev/null 2>&1 &
Then:
mysql mysql -uroot //登陆 mysql> UPDATE user SET Password=PASSWORD(‘new password’) where USER=’root’; mysql> FLUSH PRIVILEGES; mysql> quit
Then restart mysql
/etc/init.d/mysql start
OK This is done. If you feel this is complicated, you can use the second method.
The above is the detailed content of lamp how to change mysql password. For more information, please follow other related articles on the PHP Chinese website!