问题现象:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

原因分析:由于密码错误等原因导致连接失败。

解决办法:修改用户名对应密码

root@hao-ubuntu:/usr/local/autotest# /etc/init.d/mysql stop
root@hao-ubuntu:/usr/local/autotest# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 1828
root@hao-ubuntu:/usr/local/autotest# 120502 13:59:51 mysqld_safe Logging to syslog.
120502 13:59:52 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql -uroot mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.62-0ubuntu0.11.04.1 (Ubuntu)

Copyright (c) 2000, 2011, 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.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
root@hao-ubuntu:/usr/local/autotest# /etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mysql ; start mysql. The restart(8) utility is also available.
mysql start/running, process 1979
root@hao-ubuntu:/usr/local/autotest# mysql -uroot -proot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 35
Server version: 5.1.62-0ubuntu0.11.04.1 (Ubuntu)

Copyright (c) 2000, 2011, 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>

转载于:https://www.cnblogs.com/haochuang/archive/2012/05/02/2478955.html

【QA5】【mysql问题】ERROR 1045 (28000): Access denied for...相关推荐

  1. 转: windows系统下mysql出现Error 1045(28000) Access Denied for user 'root'@'localhost'

    windows系统下mysql出现Error 1045(28000) Access Denied for user 'root'@'localhost' 转自 http://zxy5241.space ...

  2. 【MySQL】ERROR 1045 (28000): Access denied for user的解决方法

    [MySQL]ERROR 1045 (28000): Access denied for user的解决方法 参考文章: (1)[MySQL]ERROR 1045 (28000): Access de ...

  3. MAC电脑:安装mysql报ERROR 1045 (28000)Access denied

    问题:安装mysql时报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 1.my ...

  4. windows 下 安装mysql 出现 “ ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password

    这个问题是在Windows下安装MySQL服务时遇到的,使用MySQl绿色版进行安装的,安装完成后,连接到MySQL服务时输入命令 " mysql -uroot -p " ,因为时 ...

  5. MySQL错误ERROR 1045 (28000): Access denied for user 'root'@'localhos

    转载出处玮璘博客:http://www.wangweilin.name/rj_446.html 错误描述: Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Acces ...

  6. Centos7解决MySQL登录ERROR 1045 (28000): Access denied for user ‘‘@‘localhost‘ (using

    ​小知识,大挑战!本文正在参与"程序员必备小知识"创作活动. 登录数据库时,发现数据库连接不上,报错如下: ERROR 1045 (28000): Access denied fo ...

  7. 【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 (2800 ...

  8. 完整过程解决 ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: NO)

    ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: NO) 此问题网上大部分都是围绕下面的第 ...

  9. mysql 5.7 ERROR 1045 (28000): Access denied for user 'root'@'localhost'

    mysql 安装了最新版,但是初始化登陆不了,网上找了很多资料,但是都没用,后来在网上看到说是新版本的mysql初始化安装会随机生成一个root密码,如果你不知道这个密码,或者没有留意到这个密码,则会 ...

  10. mysql报错:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘

    在Ubuntu安装好MySQL后报错 安装命令(Ubuntu 20.04): sudo apt install mysql-server sudo systemctl start mysql.serv ...

最新文章

  1. 大型运维环境实施安全加固
  2. 用户第一次登录后要求修改密码
  3. layer.js载入失效问题
  4. 一篇文章带你飞,轻松弄懂 CDN 技术原理
  5. DVWA——Sqlmap练习
  6. PCA原理分析和意义(一)
  7. 你的adonis用对了吗?不同因素的顺序竟然对结果有很大影响
  8. 多城市教育培训机构行业企业站群系统源码-强大的SEO功能-内置三千多个城市
  9. 华为 “Telnet” 登录设备
  10. SpringCloud学习之Hystrix
  11. python dataframe 取每行的最大值_在pandas DataFrame中查找列的值最大的行
  12. matlab教程 for循环,Matlab简单教程:循环
  13. 电脑分屏设置主屏_如何实现电脑屏幕分屏操作?
  14. 电脑端10大图片处理类神器
  15. Windows远程控制家里的电脑
  16. python37.dll缺失是什么情况_修复python37.dll
  17. Windows各版本符号表离线下载
  18. Python获取Win7,Win10系统缩放大小
  19. AMBA总线---APB总线协议
  20. windows mysql 配置最大连接数_MYSQL 最大连接数设置

热门文章

  1. Fastformer:简单又好用的Transformer变体!清华MSRA开源线性复杂度的Fastformer!
  2. 阿里摩酷实验室CV实习生和社招
  3. 【项目合作】海隆石油工业集团诚邀巡检识别工程合作伙伴
  4. linux密码过期不修改,Linux解决用户密码过期但不用修改密码的方法
  5. mysql磁盘io高是什么造成_FAQ | 是什么导致MySQL数据库服务器磁盘I/O高(本文章来自知数堂)...
  6. 最近目标检测新范式汇总SparseRCNN,OneNet,DeFCN等
  7. 收藏 | 使用 Mask-RCNN 在实例分割应用中克服过拟合
  8. Facebook官方出品~时域音频分离模型登GitHub热榜
  9. java 旅行家的预算_旅行家的预算
  10. RGB-D dataset