Solution to remote connection to MySQL error 1130 code

Source: Internet
Author: User

I am using a remote connection to the MySQL server database today. No matter how it is connected, the error code is 1130, error 1130: Host 192.168.2.159 is not allowed to connect to this MySQL Server

It is assumed that the remote connection User Permissions cannot be granted. As a result, the MySQL database can be operated.

After logging on to MySQL with IP address 127.0.0.1, change the "host" entry in the "user" table in the "MySQL" database to "%" from "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 ';
The first sentence is to authorize the User Root to log on.
Second sentence: Select MySQL database
Third sentence: view the host value of the User table in the MySQL database (the host/IP name that can be accessed through connection)
Fourth sentence: Modify the host value (add host/IP address with the wildcard % content), of course, you can also directly add IP addresses
Fifth sentence: refresh the MySQL system permission table
The sixth statement is modified when you re-view the user table ..
Restart the MySQL service.
======================================
1. This error occurs when you connect to MySQL through mysql-front or MySQL administrator.
Error 1130: Host ***. *** is not allowed to connect to this MySQL Server
This indicates that the connected user account does not have the permission for remote connection and can only log on to the Local Machine (localhost.
You need to change the host entry in the User table of the MySQL database.
Rename localhost as %
First, log on to the MySQL server by following the steps below
To log on to MySQL, you need to switch to the bin directory of MySQL under DOS and perform the following operations:
Syntax format: mysql-H host_name-u user_name-P password (Local-H and host_name can be saved)
For example:
C: \ Program Files \ mysql \ MySQL Server 5.0 \ bin> mysql-u root-P
Enter Password :******
Enter the username and password (-P), press enter, and then "Enter Password:". Then enter the password and press Enter.
Log on to MySQL. Otherwise, the logon fails.
After successful login, the following information and MySQL identifier are displayed:
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>

Related Article

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.