Access denied for user 'root'@'localhost' (using password:YES) 解决方案
来源:互联网 发布:校验md5码软件 编辑:程序博客网 时间:2024/03/29 15:22
关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑。
关于这个问题,找了很久的解决方案,也换了盘符重装了好几次,问题依旧。 有网上说打开MySQL 的 MySQL 5.5 Command Line Client,在里面进行一系列的操作即可。但是此界面进来就要输入密码:
无论输入什么都直接退出。没撤了。 (哦,对了,期间,我还试过,在安装MySQL的时候不设置密码。安装成功后,还是报错。) 网上看了一大堆的解决办法,都不行。最后,结合一些办法,终于解决问题了。至于我的做法对不对?我不知道,但是确实解决了问题。也许还有其他的更好的解决方案,如果兄弟姐妹们知道的话,希望也能与我分享一下,不胜感激。
今早打开电脑,开始-运行 输入“mysql -uroot -pmyadmin”后出现以下错误:
“Access denied for user 'root'@'localhost' (using password:YES)”
直接输入“mysql” 也回报类似的错误:应该是:
“Access denied for user 'ODBC'@'localhost' (using password:NO)”具体的不记得了,貌似是这个。
解决方案:
1、打开MySQL目录下的my.ini文件(如果不是这个名,比如我的是my-default.ini,直接把它重命名为my.ini就行了),在文件的最后添加一行“skip-grant-tables”,保存并关闭文件。
2、重启MySQL服务。
3、在命令行中输入“mysql -uroot -p”(不输入密码),回车即可进入数据库。
4、执行,“use mysql;”使用mysql数据库。
5、执行,“update user set password=PASSWORD("rootadmin") where user='root';”(修改root的密码)
(期间我还select下user表中的记录,查询全部的时候显示了一些乱码,然后我只查询了user表中的Host、User、Password字段,貌似当时显示了3条记录,有1个没有名称。当然,为了解决问题,这些我也管不了了。)
6、打开MySQL目录下的my.ini文件,删除最后一行的“skip-grant-tables”,保存并关闭文件。
7、重启MySQL服务。
8、在命令行中输入“mysql -uroot -prootadmin”,问题搞定!
原文地址:http://blog.csdn.net/ldl22847/article/details/7941962
0 0
- 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) 解决方案
- 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) 解决方案
- 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
- 快速排序(二)
- 快速找到单链表的中间节点
- 窗口有关算法题目
- Zookeeper学习
- 适配器模式adapter
- Access denied for user 'root'@'localhost' (using password:YES) 解决方案
- [algorithm]2月29日
- SDUST SingleTest A(15.4.3)
- myeclipse10 js报错 jslib报错
- 根据首字母查找单词
- P122第21题
- UIView
- (7-2)hive参数配置使用
- Career Classification – Possible Career Options