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 ...
随机推荐
- python部分内容存档
笨办法学python. 1 Ec6字符串和文本... 1 ec7. 1 ec8. 1 Ec9. 1 Ec10 转义字符... 1 Ec11提问... 1 raw_input和input的区别... 1 ...
- C++运算符重载规则
运算符重载时要遵循以下规则: ( 1 ) 除了类属关系运算符 " . " .成员指针运算符 " .* " .作用域运算符 " :: " . ...
- 洛谷P2286 [HNOI2004]宠物收养所 [STL,平衡树]
题目传送门 宠物收养所 题目描述 凡凡开了一间宠物收养场.收养场提供两种服务:收养被主人遗弃的宠物和让新的主人领养这些宠物. 每个领养者都希望领养到自己满意的宠物,凡凡根据领养者的要求通过他自己发明的 ...
- cf 633B A trivial problem
Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an i ...
- bzoj4556: [Tjoi2016&Heoi2016]字符串 (后缀数组加主席树)
题目是给出一个字符串,每次询问一个区间[a,b]中所有的子串和另一个区间[c,d]的lcp最大值,首先求出后缀数组,对于lcp的最大值肯定是rank[c]的前驱和后继,但是对于这个题会出现问题,就是题 ...
- BZOJ4556 HEOI2016 字符串
后缀数组. 复习了后缀数组后发现这题真的很好写. 我们只需要将c依次向前向后扩展,找落在[a,b]区间内的最大值,遍历过程中不断用height数组更新. 复杂度就是后缀数组,比主席树的快多了. By: ...
- 51nod1805 小树 prufer序列 + 容斥原理
首先考虑$prufer$序列,那么问题转化为求 一个长为$n - 2$的序列,总共有$n$个元素,恰有$m$个元素不出现在序列中的方案数 考虑容斥,答案即为 至少$m$个元素不出现 - 至少$m + ...
- [BZOJ4423][AMPPZ2013]Bytehattan(对偶图+并查集)
建出对偶图,删除一条边时将两边的格子连边.一条边两端连通当且仅当两边的格子不连通,直接并查集处理即可. #include<cstdio> #include<algorithm> ...
- [BZOJ4553][TJOI2016&&HEOI2016]序列(CDQ分治)
4553: [Tjoi2016&Heoi2016]序列 Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 1202 Solved: 554[Su ...
- Linux的十个最危险的命令
Linux命令行佷有用.很高效,也很有趣,但有时候也很危险,尤其是在你不确定你自己在正在做什么时候. 这篇文章将会向你介绍十条命令,但你最好不要尝试着去使用. 当然,以下命令通常都是在root权限下才 ...