Home  >  Article  >  Database  >  MysQL数据库修改密码_MySQL

MysQL数据库修改密码_MySQL

WBOY
WBOYOriginal
2016-06-01 13:07:34958browse

1.打开MySQL命令行窗口

2.输入员密码进入

3.键入如下命令: mysql>UPDATE mysql.user SET password=PASSWORD('newpassword') WHERE User='root';

4.执行完上面命令后会出现如下信息:Query OK, 0 rows affected (0.00 sec) Rows matched: 2  Changed: 0  Warnings: 0

5.然后还需键入如下命令:mysql>FLUSH PRIVILEGES; 否则密码不会被修改;

6.执行之后如果出现下面信息,那么恭喜你密码修改成功:Query OK, 0 rows affected (0.16 sec)

7.键入此命令行可现实当前user:mysql>SELECT USER();

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