首页 > 数据库技术 > 详细

mysql更改密码

时间:2017-05-19 12:43:52      阅读:347      评论:0      收藏:0      [点我收藏+]

1:首先是mysql服务启动着

2:打开DOS如下,win7系统

 

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd C:\Program Files (x86)\MySQL\MySQL Server 7.0\bin  ------进入到数据库安装目录的bin目录下

C:\Program Files (x86)\MySQL\MySQL Server 7.0\bin>mysql -uroot -p  -------------打开mysql
Enter password: ****-------自动提示输入密码
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.39-ndb-7.0.9-cluster-gpl MySQL Cluster Server (GPL)

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. ---------成功登陆

mysql> set password for root@localhost = password(‘test‘);-------修改密码
Query OK, 0 rows affected (0.00 sec)

mysql> exit----退出
Bye

C:\Program Files (x86)\MySQL\MySQL Server 7.0\bin>mysql -uroot -p-----再次登录
Enter password: ****-----输入原密码
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: Y----------------原密码报错登不上
ES)

C:\Program Files (x86)\MySQL\MySQL Server 7.0\bin>mysql -uroot -p-------再次尝试登录
Enter password: ****------输入新密码
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.39-ndb-7.0.9-cluster-gpl MySQL Cluster Server (GPL)

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql>-------成功登陆,密码被修改了

mysql更改密码

原文:http://www.cnblogs.com/xueershewang/p/6877774.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!