Home > Database > Mysql Tutorial > MySQL忘记密码恢复密码的实现方法_MySQL

MySQL忘记密码恢复密码的实现方法_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:49:57
Original
862 people have browsed it

bitsCN.com

1. 向mysqld server 发送kill命令关掉mysqld server(不是 kill -9),存放进程ID的文件通常在MYSQL的数据库所在的目录中。 
killall -TERM mysqld 
你必须是UNIX的root用户或者是你所运行的SERVER上的同等用户,才能执行这个操作。 
2. 使用`--skip-grant-tables' 参数来启动 mysqld。 (LINUX下/usr/bin/safe_mysqld --skip-grant-tables , windows下c:/mysql/bin/mysqld --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. 载入权限表: `mysqladmin -h hostname flush-privileges' ,或者使用 SQL 命令`FLUSH PRIVILEGES'。 
5.killall -TERM mysqld 
6.用新密码登陆 

bitsCN.com
Related labels:
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