'Access denied for user 'root'@'localhost' (using password: YES)'
来源:互联网 发布:网络小项目 编辑:程序博客网 时间:2024/04/29 07:23
解决方法:
打开Mysql Command Line Client,输入密码;
mysql>use mysql;
mysql> UPDATE user SET Password='newpassword' where USER='userName';
mysql> FLUSH PRIVILEGES;
mysql> quit;
之后出现的问题: "Host 'localhost' is not allowed to connect to this MySQL server"
MYSQL是有个访问控制表,root的访问控制表未更新,就导致了无法访问mysql
网上找到的解决方法,应该是跳过该表就可以直接使用了,但是这个放在服务器上还是会有一定的风险,那就是任何人在任何地方都可以访问你的MYSQL,如果安全重要的话还是重新装一下数据库好了。
解决方法如下:
----------------------------------------
编辑 my.ini linux下为/etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
例如:
[mysqld]
datadir=/var/lib/mysql
skip-grant-tables
目的是为了:
跳过MySQL的访问控制,任何人都可以在控制台以管理员的身份进入MySQL数据库。
需要注意的是在修改完密码以后要把MySQL服务器停掉重新启动才会生效
重启mysql服务!
OK!
0 0
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES) 问题解决
- 解决'Access denied for user 'root'@'localhost' (using password: YES)'
- access denied for user 'root'@'localhost' using password yes
- access denied for user 'root'@'localhost' using password yes
- 1045 access denied for user 'root'@'localhost' using password yes
- Access denied for user 'root'@'localhost' (using password: YES)解决办法
- Access denied for user: 'root@localhost' (Using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password:YES) 解决方案
- mysql Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password:YES)
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- mysql Access denied for user 'root'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES)
- MySql Access denied for user 'root'@'localhost' (using password: YES)
- Java RandomAccessFile用法
- Linux makefile 教程
- OpenGL函数思考-glRotatef
- 重构-改善既有代码的设计(2.3)
- snmp-snmptrap
- 'Access denied for user 'root'@'localhost' (using password: YES)'
- JAX-RS入门 一 :基础
- linux上的free命令
- Oracle 表创建序列-触发 实现表ID自动增长
- OpenGL函数思考-glTexImage2D
- eclipse安装hibernate tools插件
- Android的Activity的launchMode与onActivityResult方法的关系
- Axis2 Web服务配置文件services.xml详解
- makeObjectsPerformSelector 方法的用法