ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
来源:互联网 发布:js定义json对象 编辑:程序博客网 时间:2024/06/15 01:34
一:问题描述
--登陆mysql
[root@target_pc software]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
二:解决办法
[root@target_pc software]# /etc/init.d/mysql stop
Shutting down MySQL.. [ OK ]
[root@target_pc software]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 3119
[root@target_pc software]# 140918 23:02:23 mysqld_safe Logging to '/var/lib/mysql/target_pc.err'.
140918 23:02:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
--它会停留在这个界面一段时间,感觉需要一直等待一样,此时,直接回车就行了。
[root@target_pc software]# mysql -u root -p
Enter password:
--这里不用输入密码,直接回车就行了。
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.20 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> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set password=password('beijing') where user='root';
Query OK, 4 rows affected (0.01 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@target_pc software]# /etc/init.d/mysql restart
Shutting down MySQL..140918 23:07:25 mysqld_safe mysqld from pid file /var/lib/mysql/target_pc.pid ended
[ OK ]
Starting MySQL. [ OK ]
[1]+ Done mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@target_pc software]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.20
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>
可以正常登陆了。
--如果执行语句时报错:
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
解决办法:
--重新设置一次密码:
mysql> SET PASSWORD=PASSWORD('beijing')
-> ;
Query OK, 0 rows affected (0.00 sec)
--现在,再输入命令,就不再报错了:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
- error: 'Access denied for user 'root'@'localhost' (using password: YES)'
- ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password:YES)
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- ERROR 1045 (28000): Access denied for user’root’@'localhost’(using password:YES)
- ERROR 1045 (28000): Access denied for user root@localhost (using password: YES)
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决办法
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password: YES)
- ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password:YES)最近解决方法在!
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- mysql报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- PHP正则表达式的快速学习方法
- IOS 编程中要注意的细节
- 音视频解决方案Web平台之背景水印更改
- 每天一个JavaScript实例-处理textarea中的字符成每一行
- Python错误汇总
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- TortoiseGit Resolving deltas: 100%问题的解决
- idea优化设置/取消自动保存
- Linux源码安装mysql 5.6.12 (cmake编译)
- 问题10:临时表空间中的临时文件损坏、丢失的情况下如何恢复?
- 查看Oracle版本以及一些Oracle操作
- 施乐XEROX DC 25050652526550760033004400数码印刷战斗机
- javascript解决长度字符长度问题
- 施乐XEROX DC 25050652526550760033004400数码印刷战斗机