Access denied for user 'root'@'localhost' (using password:YES)解决方法
在MySQL的使用过程中,我们可能会碰到“Access denied for user 'root'@'localhost' (using password:YES)”的问题,那么接下来我们就来解决它。
经过我的百度查询最后得出结论:出现这种错误有两种可能,一是MySQL的root用户的密码错误,二是权限不够的问题。通常解决办法是修改密码。。。
由于我使用的是Windows系统,所以方法也是Windows系统的修改方法:
1、开始 → 搜索栏里面输入cmd → 右键cmd.exe选择以管理员的身份运行(亦可以在C:\Windows\System32目录下找到这个cmd.exe,右键,以管理员身份运行)
2、输入net stop mysql停止MySQL服务
3、输入命令行来到mysql的bin目录下,输入下列粗体命令
D:\MySQL\bin>mysqld --defaults-file="D:\MySQL\my.ini" --console --skip-grant-tables
等一下,显示出以下结果说明MySQL启动:
22:26:09 [Warning] The syntax '--log' is deprecated and will be removed inMySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
22:26:09 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'-- slow_query_log_file' instead.
22:26:09 [Warning] The syntax '--log' is deprecated and will be removed in MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
22:26:09 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file' instead.
22:26:09 [ERROR] The update log is no longer supported by MySQL in version 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log-bin='' instead.
22:26:09 InnoDB: Started; log sequence number 0 324221
22:26:09 [Note] mysqld: ready for connections.Version: '5.1.33-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
4、再以管理员的身份打开一个cmd.exe,输入命令行来到mysql的bin目录下,输入:mysql -uroot mysql
5、进入mysql之后,输入命令行修改密码:
mysql>update user set authentication_string=password('123456') where user='root';
6、刷新权限:mysql>flush privileges;
7、退出mysql:mysql> quit;
8、关闭MySQL:D:\MySQL\bin>mysqladmin shutdown(出现错误,则:mysqladmin -uroot -p shutdown 然后输入新密码)
9、至此修改密码完成,可以输入命令行:net start mysql 启动MySQL服务,mysql -uroot -p ,输入密码就可以进入mysql了。
Access denied for user 'root'@'localhost' (using password:YES)解决方法的更多相关文章
- MySQL------报错Access denied for user 'root'@'localhost' (using password:NO)解决方法
报错:Access denied for user 'root'@'localhost' (using password:NO) 原因:没有给用户“root'@'localhost”赋予数据库权限 解 ...
- 转载--MYSQL5.7:Access denied for user 'root'@'localhost' (using password:YES)解决方法
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行"skip-grant-tables",保存并关闭文件; 2.重启MySQL服务; 3.通过cmd行进入MySQL的 ...
- linux下mysql出现Access denied for user 'root'@'localhost' (using password: YES)解决方法
# /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # my ...
- ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决办法
问题:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 很久没用这台电脑的mysql ...
- mac 安装mysql + 修改root用户密码 + 及报Access denied for user 'root'@'localhost' (using password:YES)解决办法
1.下载MySQL 到mysql的官网http://dev.mysql.com/downloads/mysql/然后在页面中会看到“MySQL Community Server”下方有一个“downl ...
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 解决办法
一.背景 在Spark中,将DStream写入到MySQL出现错误:java.sql.SQLException: Access denied for user 'root'@'localhost' ( ...
- Access denied for user 'root'@'IP' (using password:YES)解决方法
在MySql的使用过程中,碰到“Access denied for user 'root'@'IP' (using password:YES)”的问题,使用以下语句修改后还是不行. GRANT ALL ...
- 连接mysql报错Access denied for user 'root'@'localhost' (using password: YES)解决办法
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”(免密码登录),保存并关闭文件,重启MySQL服务. 2.通过命令行进入MySQL的BIN目录,输 ...
- MySQL出现 Access denied for user 'root'@'localhost' (using password:YES) 解决办法
1.先停止MySQL服务,然后在MySQL安装目录(我的是C:\Program Files (x86)\MySQL\MySQL Server 5.1)找到my.ini文件,在最后一行添加skip-gr ...
随机推荐
- HttpCookieCollection类
一.最近在研究HttpRequest类的时候,发现返回的cookie集合是存在放这个类的对象的.而实际上这个类只是一个HttpCookie对象的集合,关于HttpCookie类可以查看http://w ...
- google code 或 git 免用户名和密码 .netrc 在windows中的操作 _netrc
1.首先用不包含用户名URL CLONE “git clone https://code.google.com/p/YourProjName/” .而不能用 “git clone https://Yo ...
- golang显示本机IP代码
package main import ( "fmt" "net" ) func main() { addrs, err := net.InterfaceAdd ...
- js 正则用空格分割字符串
var filename = "ASDFK*SADF+ALDLAS-LDKFADFa*seAc tion.java";var arr = filename.split(/\*|\- ...
- Guid 几种格式化
//32 位数字:00000000000000000000000000000000 Console.WriteLine(Guid.NewGuid().ToString("N")); ...
- java操作Excel之POI(5)利用POI实现使用模板批量导出数据
后台导出方法: 在源文件夹src下面放个准备好的模板:/com/cy/template/userExportTemplate.xls,这个模板有头部一行: /** * 后台导出方法 * 利用POI实现 ...
- 3dsMax模型转UE4
转自:http://blog.csdn.net/qq_24835213/article/details/68063344 一.模型设置: 1.将Vary材质转成标准材质 2.将模型减面 3.加一套UV ...
- 特征选择:方差选择法、卡方检验、互信息法、递归特征消除、L1范数、树模型
转载:https://www.cnblogs.com/jasonfreak/p/5448385.html 特征选择主要从两个方面入手: 特征是否发散:特征发散说明特征的方差大,能够根据取值的差异化度量 ...
- tornado.ioloop.IOLoop相关文章
http://6167018.blog.51cto.com/6157018/1532899 http://kenby.iteye.com/blog/1159621
- Hibernate 一对多/多对多
一对多关联(多对一): 一对多关联映射: 在多的一端添加一个外键指向一的一端,它维护的关系是一指向多 多对一关联映射: 咋多的一端加入一个外键指向一的一端,它维护的关系是多指向一 在配置文件中添加: ...