Access denied for user 'root'@'IP' (using password:YES)解决方法

在MySql的使用过程中,碰到“Access denied for user ‘root‘@‘IP‘ (using password:YES)”的问题,使用以下语句修改后还是不行。

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘password‘ WITH GRANT OPTION;
FLUSH PRIVILEGES; 

最后是通过以下步骤修改就不报错了。

1、开始 → 搜索栏里面输入cmd → 右键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启动:

  170215 22:26:09 [Warning] The syntax ‘--log‘ is deprecated and will be removed  inMySQL 7.0. Please use ‘--general_log‘/‘--general_log_file‘ instead.
  170215 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.
  170215 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.
  170215 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.
  170215 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.
  170215 22:26:09  InnoDB: Started; log sequence number 0 324221
  170215 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;

Access denied for user 'root'@'IP' (using password:YES)解决方法

原文地址:https://www.cnblogs.com/foxting/p/9517592.html

时间: 2024-07-30 00:18:05

Access denied for user 'root'@'IP' (using password:YES)解决方法的相关文章

MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES)解决方法

本人配置:系统64位win10,MySQL8.0.16 错误 :ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) 从上面这段英文的意思来看,可以这样分析,第一:Access denied(拒绝访问):第二:using password:NO/YES.这里这个using password 的是是否输入了密码,输入了就表示YES,没有就输出NO. 根据网上查了很多资料,出现Acces

Access denied for user 'root'@'localhost' (using password:YES) 解决方法

当遇到应用程序连不上MySQL但是workbench可以连接上时,使用 workbench 进入 Server Administration 选项卡,进行服务端管理,然后进入 SECURITY-Users and Privileges选项卡,依下图设置即可. Access denied for user 'root'@'localhost' (using password:YES) 解决方法

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决办法

问题重现(以下讨论范围仅限Windows环境): C:\AppServ\MySQL> mysql -u root -pEnter password:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 编辑mysql配置文件my.ini(不知道在哪请搜索),在[mysqld]这个条目下加入  skip-grant-tables保存退出后重启mysql 1.点击“开始”->“运行”(

django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")解决

Django错误又来了,数据库的连接问题......... 出现django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)"),说明自己设置的密码错误,在setting.py中改即可. 就是图中涂抹的位置,改为自己数据库的密码. django.db.utils.OperationalError: (1045, "Access

连接mysql报错Access denied for user 'root'@'localhost' (using password: YES)解决办法

1.打开MySQL目录下的my.ini文件,在文件的最后添加一行"skip-grant-tables"(免密码登录),保存并关闭文件,重启MySQL服务. 2.通过命令行进入MySQL的BIN目录,输入"mysql -u root -p"(不输入密码),回车即可进入数据库. 3.执行"use mysql;",使用mysql数据库. 4.修改密码:执行" update MySQL.user set authentication_strin

MySQL出现 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决办法

进入cmd 输入 mysql -u root -p 出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 找到安装mysql的根目录打开 my.ini文件 添加一条语句 skip-grant-tables 保存后退出 进入cmd 输入net stop mysql; 停止mysql  然后在开启 net start mysql;  这步是修改完文件后重启一下 然后在 输入 mysq

Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

最近操作mysql 5.6, 出现了以下问题. 分享,感谢原著: 案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit 案例介绍: 今 天开始学习mysql,遂先安装了Mysql 5.6.19 64bit 版本的数据库,结果安装成功了,但是使用root登录时遇到了ERROR 1045 (28000): Access denied for user '

Linux mysql 5.7: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

环境:mac10.12 来源:http://www.cnblogs.com/kerrycode/p/3861719.html 使用root登录时遇到了ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)错误. 如下所示 [[email protected] tmp]# rpm -ivh MySQL-server-5.6.19-1.rhel5.x86_64.rpm Preparing..

Access denied for user 'root'@'localhost' (using password: YES) (可以正确解决)

本文为大家讲解的是mysql错误:Access denied for user 'root'@'localhost' (using password: YES)解决方法,感兴趣的同学参考下. 注意: 加红色的地方是重点 错误描述 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案 windows环境 编辑mysql配置文件my.ini(不知道在哪请搜索),在[mysqld