您的位置:首页 > 数据库 > MySQL

MySQL 5.5 正确配置 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y ES)

2017-08-09 16:28 501 查看
第一步:C:\Program Files (x86)\MySQL\bin>net stop mysql

mysql 服务正在停止.

mysql 服务已成功停止。

第二步:

mysql>C:\Program Files (x86)\MySQL\bin>mysqld --skip-grant-tables

第三步:

C:\Program Files (x86)\MySQL\bin>net start mysql

mysql 服务正在启动 ..

mysql 服务已经启动成功。

第四步:

C:\Program Files (x86)\MySQL\bin>mysql -u root mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.38 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

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

第五步:

mysql> UPDATE user SET Password=PASSWORD('root') where USER='root';

Query OK, 3 rows affected (0.07 sec)

Rows matched: 3  Changed: 3  Warnings: 0

第六步:

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.01 sec)

第七步:

mysql> quit

Bye

第八步:

C:\Program Files (x86)\MySQL\bin>net start mysql

请求的服务已经启动。

第九步:

C:\Program Files (x86)\\MySQL\bin>mysql -u root -p

Enter password: ****

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.5.38 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

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

mysql>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐