1130 Host ‘localhost’ is not allowed to connect to this MySQL server,解决步骤

一级标题1130 Host ‘localhost’ is not allowed to connect to this MySQL server,解决步骤

六级标题第一步:在mysql的安装目录下找到 my.ini文件用记事本打开
六级标题第二步:在[mysqld]下粘贴

skip-grant-tables
在这里插入图片描述

六级标题第三步:重启数据库(用管理员身份运行命令提示符)

在这里插入图片描述

六级标题第四步:输入代码黑体部分

Microsoft Windows [版本 10.0.18363.1440]
© 2019 Microsoft Corporation。保留所有权利。

C:\WINDOWS\system32>net stop mysql
MySQL 服务正在停止…
MySQL 服务已成功停止。

C:\WINDOWS\system32>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

C:\WINDOWS\system32>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> insert into user(User,Password) values(‘root’,PASSWORD(‘123456’));
ERROR 1046 (3D000): No database selected
mysql> use mysql
Database changed
mysql> insert into user(User,Password) values(‘root’,PASSWORD(‘123456’));
ERROR 1364 (HY000): Field ‘ssl_cipher’ doesn’t have a default value
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

mysql> grant all privileges on mysql. to root@localhost identified by ‘123456’;*
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant reload on . to ‘root’@‘localhost’;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

六级标题删除skip-grant-tables,重启服务器

C:\WINDOWS\system32>net stop mysql
MySQL 服务正在停止…
MySQL 服务已成功停止。

C:\WINDOWS\system32>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值