Home >Database >Mysql Tutorial >丢失MySQL root 密码?_MySQL

丢失MySQL root 密码?_MySQL

WBOY
WBOYOriginal
2016-06-01 13:34:281115browse

bitsCN.com

1 先停止掉 MYSQL 服务

/etc/init.d/mysqld stop

2 使用 mysqld_safe 安全登录

mysqld_safe --skip-grant-tables &

3 执行登录,修改密码等

mysql -u -rootuse mysql;update user set password=password('your new password') where user='root';exit;

4 重新启动MySQL服务

/etc/init.d/mysqld start

 

bitsCN.com
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