Home > Database > Mysql Tutorial > Linux下MySQL Error 1130 不能远程访问

Linux下MySQL Error 1130 不能远程访问

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:57:34
Original
1039 people have browsed it

最近做Linux项目用到MySQL数据库,可是远程连接MySQL时总是报出erro 2003: Can

最近做Linux项目用到MySQL数据库,可是远程连接MySQL时总是报出erro 2003: Can't connect to MySQL server on '211.87.***.***' (111),昨天查了好几个小时才找到解决方案,如下:

1.sudo gedit /etc/mysql.my.cnf

找到bind-address                                  =127.0.0.1

修改为bind-address                               =0.0.0.0

2.sudo /etc/init.d/ mysql restart

在这种情况下如果再尝试远程连接,则会报出ERROR 1130 (HY000): Host '211.87.***.***'is not allowed to connect to this MySQL server提示信息,,不能远程连接数据库。

在MySQL host上按如下命令操作

mysql -u root -ppassword    //进入mysql控制台

mysql>use mysql;

mysql>update user set host = '%' where user = 'root';    //这个命令执行错误时可略过

mysql>flush privileges;

mysql>select host, user from user; //检查‘%’ 是否插入到数据库中

mysql>quit

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template