MYSQL错误1130:ERROR 1130: Host 10.10.36.115 is not allowed to connect to this MySQL server
解决远程连接mysql错误1130代码的方法
在用远程连接Mysql服务器的数据库,不管怎么弄都是连接不到,错误代码是1130,ERROR 1130: Host 10.10.36.115 is not allowed to connect to this MySQL server
猜想是无法给远程连接的用户权限问题。结果这样子操作mysql库,即可解决。在本机登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost”改称'%'。。
mysql -u root -p
mysql>use mysql;
mysql>select 'host' from user where user='root';
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;
mysql>select 'host' from user where user='root';
第一句是以权限用户root登录
第二句:选择mysql库
第三句:查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)
第四句:修改host值(以通配符%的内容增加主机/IP地址),当然也可以直接增加IP地址
第五句:刷新MySQL的系统权限相关表
第六句:再重新查看user表时,有修改。。
重起mysql服务即可完成。
============================
一、通过MySQL-Front或mysql administrator连接mysql的时候发生的这个错误
ERROR 1130: Host ***.***.***.*** is not allowed to connect to this MySQL server
说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。
需更改 mysql 数据库里的 user表里的 host项把localhost改称%
首先按下面的步骤登录Mysql服务器
登录mysql需要切换到dos下的mysql的bin目录,进行如下操作:
语法格式:mysql -h host_name -u user_name -p password (本机的话-h 和host_name可省)
例如:
C:\program files\mysql\mysql server 5.0\bin>mysql -u root -p
Enter password:******
先输入用户名和密码登陆要求(-p),回车后等出现"Enter password:",再输入密码回车,这样就可以成功登陆mysql,否则将会登陆失败。
登陆成功后会显示如下信息及Mysql标识符:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.1-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
标识符"mysql>",当你看到这个出现在窗口的最左边的顶格时,这就是告诉你,你可以输入命令进行操作了。
mysql> \s 查看版本信息
mysql> \q or mysql> quit 退出mysql数据库服务器
mysql> \h or mysql> help 查看帮助(其他的数据库服务器相关命令)
二、登录成功后可通过以下步骤对用户进行权限更改
mysql>use mysql;
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;
mysql>select 'host','user' from user where user='root';
mysql>quit
退出后会回到DOS正常的提示符状态,此时可以通过远程连接Mysql了!
=====================================================================
MySQL 用户帐号的修改 error 1130
MySQL上的一个数据库要备份,装了个MySQL的gui工具。打开"MySQL Administrator"工具,填好用户名和密码却登录不了,报一个错“ERROR 1130: Host ' ip地址 ' is not allowed to connect to this MySQL server”。
有这两个方法解决:
1.改表法:可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user;
2. 授权法:例如,你想root或master使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'master'@10.10.36.130 IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
我的mysql.user里root用户的host果然是localhost,先用改表法给localhost改成“%”,还是不行,仍然报1130的错误,又按“从任何主机连接到mysql服务器”方法授权,还是报一样的错,最后给自己的ip授权之后,终于登录上了。。。。
mysql的ERROR 1045 在上面情况后如再出现客户段1045可在服务器执行如下
UPDATE user SET Password=PASSWORD('123456') where USER='myuser';
FLUSH PRIVILEGES;
MYSQL错误1130:ERROR 1130: Host 10.10.36.115 is not allowed to connect to this MySQL server的更多相关文章
- 解决MySQL ERROR 1130 (HY000): Host '192.168.31.115' is not allowed to connect to this MariaDB server
# 给root用户授权 GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.31.115' IDENTIFIED BY 'root' WITH GRANT O ...
- ERROR 1130 (HY000): Host '172.16.1.54' is not allowed to connect to this MySQL server
centos7.5 远程连接数据库报错 问题: [root@db04-54 ~]# mysql -urep -p123 -h172.16.1.51 Warning: Using a password ...
- SQL Error (1130): Host '192.168.1.126' is not allowed to connect to this MySQL server
通过HeidiSQL连接MYSQL数据库报错: SQL Error (1130): Host '192.168.1.126' is not allowed to connect to this MyS ...
- 通过navicat连接mysql服务器提示SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server
新装一个mysql,尝试用通过navicat连接mysql服务器的时候提示: SQL Error (1130): Host '192.168.1.100' is not allowed to conn ...
- 错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server 是无法给远程连接的用户权限问题
错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server 是无法给远程连接的用 ...
- 解决ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL
使用navicat进行远程登录MySQL时,报出 ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL se ...
- ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MySQL server
问题 远程连接mysql时遇到如下问题: ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MyS ...
- Mysql远程连接报错:SQL Error (1130): Host '192.168.61.128' is not allowed to connect to this MySQL server
Mysql远程连接报错:SQL Error (1130): Host '192.168.0.18' is not allowed to connect to this MySQL server ...
- Mysql远程连接报错:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server
通过SQLyog连接linux中的MySQL报错问题:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this ...
随机推荐
- elementUI 学习之获取输入框的内容
<div id="app"> <el-input v-model="input1" placeholder="请输入内容" ...
- Java 深入浅出String
String String是一个被final修饰的类,直接继承于Object,同时也实现了charsequence接口,String被声明为final也就不可以被继承了.由于String的方法比较多, ...
- C++ string to char *
半伪代码: void main { string line; getline(ifs, line); replace(line.begin(), line.end(), ',', '\n'); rep ...
- jquery DOM操作(一)
上一篇文章是记录了jquery中选择器的作用,这里只要记录下jquery中的DOM操作,还是按照上篇的格式来. 下面是测试用的html代码,接下来DOM的操作会在下面的代码下进行. <body& ...
- 【BZOJ 2753】 2753: [SCOI2012]滑雪与时间胶囊 (分层最小树形图,MST)
2753: [SCOI2012]滑雪与时间胶囊 Time Limit: 50 Sec Memory Limit: 128 MBSubmit: 2457 Solved: 859 Descriptio ...
- [BZOJ2878][NOI2012]迷失游乐园(环套树DP+概率)
推荐讲解:https://www.cnblogs.com/Tunix/p/4561493.html 首先考虑树的情况,就是经典的树上概率DP.先DP出down表示从这个点向儿子走能走的期望长度,再DP ...
- bzoj 2820
收获: 当一个东西的取值有限时,我们可以枚举它,然后统计它被计算了多少次. #include <cstdio> #include <iostream> using namesp ...
- [原]Android Studio使用极光推送出现at cn.jpush.android.service.ServiceInterface.a(Unknown Source) 已解决
- HDU 5642 King's Order 动态规划
King's Order 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5642 Description After the king's speec ...
- 为什么TCP连接需要三次握手分开需要四次握手?
TCP的三次握手和四次断开TCP是一个面向连接的服务,面向连接的服务是电话系统服务模式的抽象,每一次完整的数据传输都必须经过建立连接,数据传输和终止连接3个过程,TCP建立连接的过程称为三次握手,下面 ...