Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

作者:永不消逝的黑眼圈 时间:2024-01-28 04:52:50 

右击开始图标,打开“命令提示符(管理员)”。

1、输入代码,停止服务。 

net stop MySQL57         // 我的MySQL是57版本的

2、转到mysql的bin目录下。

3、输入代码,启动mysql 跳过权限。

mysqld --skip-grant-tables
//执行到这里就只会有光标在一闪一闪无法继续写命令或输入任何命令,故重新再打开一个cmd窗口

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

4、再打开一个CMD,再次转到mysql的根目录下

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 5、输入代码,进入mysql。

mysql

 6、输入代码,刷新数据库。

flush privileges;

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 7、输入代码,使用mysql数据库。

 use mysql  
//可以看到user表

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 8、输入代码,查看本地用户。

select Host,User,authentication_string from user;

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

9、输入代码把root用户的Host修改为%。

update user set host = '%' where user ='root';

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 10、返回mysql连接页面,登录成功。

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

来源:https://blog.csdn.net/m0_46527351/article/details/127426455

标签:连接本地,报错,1130
0
投稿

猜你喜欢

  • python软件都是免费的吗

    2022-09-04 03:45:53
  • 如何删除Git本地仓库和删除GitHub上的Git远程仓库Repository(推荐)

    2023-01-30 16:07:59
  • windows安装python超详细图文教程

    2023-08-01 15:19:32
  • Python 通过监听端口实现唯一脚本运行方式

    2022-02-04 07:40:44
  • asp如何验证日期输入是否正确?

    2010-06-10 18:38:00
  • Golang 统计字符串字数的方法示例

    2024-02-17 07:35:44
  • pytorch 获取tensor维度信息示例

    2023-09-20 01:32:02
  • 一文秒懂pandas中iloc()函数

    2023-07-31 18:20:42
  • Python 实现向word(docx)中输出

    2022-08-25 01:13:13
  • MySQL分表实现上百万上千万记录分布存储的批量查询设计模式详解

    2024-01-17 18:20:01
  • python中使用psutil查看内存占用的情况

    2022-11-11 11:26:22
  • SQL Transcation的一些总结分享

    2012-08-21 10:21:28
  • Go语言接口用法实例

    2024-02-04 22:27:30
  • 用python实现超强的加密软件

    2022-12-06 11:42:50
  • python GUI计算器的实现

    2021-11-30 01:00:53
  • 基于Python的身份证号码自动生成程序

    2022-11-29 02:00:33
  • python编程学习np.float 被删除的问题解析

    2021-10-26 23:43:17
  • Windows下Python的Django框架环境部署及应用编写入门

    2021-10-08 00:58:40
  • python使用Flask框架获取用户IP地址的方法

    2023-08-09 03:15:23
  • 面向对象设计过程中必须遵守的相关准则

    2009-01-08 15:52:00
  • asp之家 网络编程 m.aspxhome.com