Mysql Error No. 1130

Source: Internet
Author: User

Mysql Database Remote Access settings

1. Modify localhost
Change the "host" entry in the "user" table in the "mysql" database to "%" from "localhost"
Mysql> use mysql;
Mysql> update user set host = '%' where user = 'root ';
Mysql> select host, user from user;
Mysql> flush privileges;

 

2. Specify authorization
Use myuser/mypassword to connect to the mysql server from any host:
Grant all privileges on *. * TO 'myuser' @ '%' identified by 'mypassword' with grant option;

Use myuser/mypassword to connect to the mysql server from a host with the ip address 192.168.225.166:
Grant all privileges on *. * TO 'myuser' @ '192. 168.225.166 'identified BY 'mypassword' with grant option;

 

3. wildcard authorization
Mysql-h localhost-u root
Mysql> grant all privileges on *. * TO 'root' @ '%' with grant option; // GRANT data access permissions TO any host as root.
Mysql> flush privileges;

 

Solve the problem that Mysql cannot be remotely connected.

1. Is the Mysql port correct?
Use netstat-ntlp to check port usage. Generally, the port is 3306. A port is used to connect to MySQl using tools. For example, My Admin \ My Query Browser \ MySQl Front.

2. Check whether the user permissions are correct.
The user table of the mysql database has two records: localhost and % (for security purpose, % can be replaced by the IP address you need to connect to the external database ).

3. Check whether skip-networking has been injected in/etc/mysql/my. cnf.
Need to be noted out
ERROR: ERROR 2003 (HY000): Can't connect to MySQL server on '192. 168.51.112 '(192)

 

Sudo gedit/etc/mysql/my. cnf
# Skip-external-locking

# Bind-address = 127.0.0.1

Skip-name-resolve

4. Check whether iptables is stopped. If no, the connection fails.
Service iptables stop is temporarily disabled.
ERROR: ERROR 2003 (HY000): Can't connect to MySQL server on '192. 168.51.112 '(192)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.