Home > Database > Mysql Tutorial > 找回mysql 的root密码_MySQL

找回mysql 的root密码_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:45:56
Original
971 people have browsed it

bitsCN.com

昨天刚装的mysql,设置了root密码,今天怎么也进不去了。
我用了一种比较常用的方法解决的。如下:
1. 向mysqld server 发送kill命令关掉mysqld server(不是 kill -9),存放进程ID的文件通常在mysql的数据库所在的目录中。
#killall -TERM mysqld
2. 使用`--skip-grant-tables' 参数来启动 mysqld。
#/usr/bin/mysqld_safe --skip-grant-tables
3. 然后无密码登录到mysqld server ,
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
你也可以这样做:`mysqladmin -h hostname -u user password 'new password''。

4.#killall -TERM mysqld
5.用新密码登陆

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