Home > Database > Mysql Tutorial > mysql root密码修改方法

mysql root密码修改方法

WBOY
Release: 2016-06-07 17:51:13
Original
919 people have browsed it

这是一篇在命令模式下来修改mysql root用户密码的一种方法,只要会点dos命令的朋友就可以轻松的完成这种操作。

cmd下切换到 安装目录

d:/mysql/bin
前提:mysql用户root密码为空.
输入 mysql -u root mysql
mysql> 状态下输入 update user set password=password('新密码') where user='root';
回显
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> 状态下输入 FLUSH PRIVILEGES;
回显
Query OK, 0 rows affected (0.00 sec)
mysql> 状态下输入 quit
退出 sql

注意每个命令后都要加上一个分号 ";"
mysql 才开始执行该行命令
而第二个指令会让已载入记忆体的 mysql 系统资料库更新

重起 mysql .
停止MYSQL
net stop mysql
开始MYSQL
net start mysql

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