Home > Database > Mysql Tutorial > body text

lamp how to change mysql password

藏色散人
Release: 2020-10-26 15:33:34
Original
2185 people have browsed it

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 &
Copy after login

Then:

mysql mysql -uroot //登陆
 mysql> UPDATE user SET Password=PASSWORD(‘new password’) where USER=’root’; 
mysql> FLUSH PRIVILEGES; mysql> quit
Copy after login

Then restart mysql

/etc/init.d/mysql start
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!