当前位置:Gxlcms > 数据库问题 > mysql更改密码

mysql更改密码

时间:2021-07-01 10:21:17 帮助过:30人阅读

------进入到数据库安装目录的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更改密码

标签:soft   登录   version   with   提示   man   type   ati   monitor   

人气教程排行