数据库连接报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
来源:互联网 发布:淘宝外贸男装店铺推荐 编辑:程序博客网 时间:2024/06/13 22:51
昨天连数据库没有问题,但是今天连接数据库就报这个错误了,网上也搜了不少的方法,有一个方法解决了我的问题。我的环境是Linux
步骤:首先需要跳过密码认证,在Linux环境中找到/etc/my.cnf文件,在文件中找到mysqld,在mysqld下边加上skip-grant-tables语句,这样的话就避过密码验证了,
然后重启mysql,/etc/init.d/mysqld restart,
进行密码的修改,
如下,
mysql> use mysql;
mysql> update user set password=password("你的新密码") where user="root";
mysql> flush privileges;
mysql> quit
然后重启MySQL,语句同上,问题解决,如果想要同时修改用户名可以使用以下语句,
mysql> use mysql;
mysql> update user set password=password("你的新密码") ,user="(要修改的用户名)" where user="root";
mysql> flush privileges;
mysql> quit
阅读全文
0 0
- 数据库连接报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)
- linux 下mysql 报 ERROR 1045 (28000): Access denied for user '-root'@'localhost' (using password: YES)
- 解决数据库连接报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)问题
- MySQL改密码报错:ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
- 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)最近解决方法在!
- SSN:Temporal Action Detection with Structured Segment Networks
- ip,icmp,tcp,upd,ftp的简单含义
- Error: Could not find or load main class org.apache.hadoop.fs.FsShell
- JDK7中的HashMap
- BZOJ——2565最长双回文串
- 数据库连接报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- 最实用的 Linux 命令行使用技巧
- Vertx简介
- 安卓动画阶段总结
- 1004. 成绩排名 (20)
- yii 框架分页
- 25、数据加密-RSA
- android studio 快捷键
- STM8S103之外部中断