MYSQL5 reset root password bitsCN.com Operating system: DEBIAN Linux 3.1
MYSQL database version: 5.0.27
(1) log on with the system root permission
(2) stop the MYSQL server:
Mysql. server stop
(3) skip the authorization table and execute the MYSQL server:
Mysqld_safe -- skip-grant-tables -- skip-networking &
(Note: the parameter -- skip-grant-tables indicates that the authorization table is skipped; -- skip-networking indicates that the TCP/IP connection is not monitored)
(4) execute the MYSQL client:
Mysql
(5) Use the mysql database
Use mysql;
(6) update the root password
Update user set password = password ('New password') where user = 'root ';
(7) shut down the mysql server and start it with the normal side.
If you are not using this version, you can find a mysqld_safe suitable for your current version in the mysql installation directory, followed by -- skip-grant-tables to skip the authorization table, the mysqld_safe version I used in my book is "safe_mysqld" (actually, I think I 've remembered it here. Where did I see that I changed sqfe_mysqld to mysqld_safe after 5.0, this caused me to find it online for half a day.) bitsCN.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.