当前位置: 首页 > news >正文

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

问题现象:

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>

相关文章:

  • 12.22 php-fpm慢执行日志
  • SIGTERM SIGINT
  • 3分钟实操机器学习原理,这里有一个不挑人的模型 | 包教包会
  • nginx负载均衡与反向代理配置文件分析实例
  • 第 26 章 MySQL
  • 如何确保SWF文件Hash值相同
  • 2017JavaScript框架战报——React分战场
  • 整理Java基础知识--Character类
  • 网上购物系统(Task005)——通用数据库访问函数集SqlHelper类
  • mysql 密码重置
  • 微软产品组里的十一类人
  • window10转Windows7
  • java生成缩略图
  • Docker 运行 jar
  • 在区块链上表白——使用C#将一句话放入比特币的区块链上
  • 网络传输文件的问题
  • [分享]iOS开发 - 实现UITableView Plain SectionView和table不停留一起滑动
  • [译]前端离线指南(上)
  • 《微软的软件测试之道》成书始末、出版宣告、补充致谢名单及相关信息
  • canvas 五子棋游戏
  • java小心机(3)| 浅析finalize()
  • JS创建对象模式及其对象原型链探究(一):Object模式
  • puppeteer stop redirect 的正确姿势及 net::ERR_FAILED 的解决
  • spring security oauth2 password授权模式
  • WordPress 获取当前文章下的所有附件/获取指定ID文章的附件(图片、文件、视频)...
  • 对JS继承的一点思考
  • 前端技术周刊 2018-12-10:前端自动化测试
  • 浅析微信支付:申请退款、退款回调接口、查询退款
  • 容器化应用: 在阿里云搭建多节点 Openshift 集群
  • 设计模式 开闭原则
  • 思考 CSS 架构
  • 用quicker-worker.js轻松跑一个大数据遍历
  • ​Java并发新构件之Exchanger
  • ​卜东波研究员:高观点下的少儿计算思维
  • !$boo在php中什么意思,php前戏
  • ###项目技术发展史
  • #Linux(权限管理)
  • #图像处理
  • $(selector).each()和$.each()的区别
  • (32位汇编 五)mov/add/sub/and/or/xor/not
  • (Matalb时序预测)PSO-BP粒子群算法优化BP神经网络的多维时序回归预测
  • (Redis使用系列) Springboot 整合Redisson 实现分布式锁 七
  • (SpringBoot)第二章:Spring创建和使用
  • (vue)页面文件上传获取:action地址
  • (八)Docker网络跨主机通讯vxlan和vlan
  • (二)springcloud实战之config配置中心
  • (附源码)springboot宠物医疗服务网站 毕业设计688413
  • (附源码)springboot社区居家养老互助服务管理平台 毕业设计 062027
  • (附源码)计算机毕业设计ssm高校《大学语文》课程作业在线管理系统
  • (五)MySQL的备份及恢复
  • (已更新)关于Visual Studio 2019安装时VS installer无法下载文件,进度条为0,显示网络有问题的解决办法
  • .cfg\.dat\.mak(持续补充)
  • .Net Web项目创建比较不错的参考文章
  • .NET精简框架的“无法找到资源程序集”异常释疑
  • .Net开发笔记(二十)创建一个需要授权的第三方组件