Home > Database > Mysql Tutorial > body text

mysql 安全模式启动重置密码

WBOY
Release: 2016-06-07 15:34:40
Original
1909 people have browsed it

1 、停止正在运行的 MySQL 进程 【 Linux 】运行 killall -TERM mysqld 2 、以安全模式启动 MySQL 【 Linux 】运行 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables 【 Windows 】在命令行下运行 X:/MySQL/bin/mysqld-nt.exe --skip-grant-tables 3

1、停止正在运行的MySQL进程

Linux】运行 killall -TERM mysqld

 

2、以安全模式启动MySQL

Linux】运行 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &

Windows】在命令行下运行 X:/MySQL/bin/mysqld-nt.exe --skip-grant-tables

 

3、完成以后就可以不用密码进入MySQL

Linux】运行 /usr/local/mysql/bin/mysql -u root -p 进入

Windows】运行 X:/MySQL/bin/mysql -u root -p 进入

 

4、更改密码

>use mysql

>update user set password=password("新密码") where user="root";

>flush privileges;

 

http://www.macophp.com/?action=show&id=3

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