Home  >  Article  >  Database  >  lamp how to change mysql password

lamp how to change mysql password

藏色散人
藏色散人Original
2020-10-26 09:39:512152browse

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.

lamp how to change mysql password

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn