Local Computer ip:192.168.1.100
remote computer ip:192.168.1.244
remote computer to open MySQL server: #/etc/init.d/mysql.server start
The local computer connects to the remote MySQL server:./mysql-h "192.168.1.244"-u root-p
The following error occurred:
ERROR 1130 (HY000): Host ' 192.168.1.100 ' isn't allowed to connect to this MySQL server
This behavior occurs because the MySQL server is only allowed to log on locally to the database server for security reasons.
Workaround:
1, the remote computer (ip:192.168.1.244) performs the following:
Start server:/etc/init.d/mysql.server start
Login server: Bin/mysql-u root-p
Using the server:mysql> use MySQL
Create a remote login user and authorize:
Mysql> grant all privileges in test.* to [e-mail protected] ' 192.168.1.100 ' identified by ' 123456 ';
The above statement indicates that all permissions to the test database are granted to Andy, which allows the Andy user to remotely log on to the IP 192.168.1.100 and set the password for the Andy user to 123456.
All parameters are analyzed below:
All privileges means giving all permissions to the specified user, which can also be replaced by assigning a specific permission, such as: Select,insert,update,delete,create,drop, and so on, with the "," half-width comma separated by the specific permissions.
Test.* means that the above permissions are for which table, test refers to the database, and the following * indicates for all tables, which can be inferred: for all databases, all tables are authorized as "*. *", and for all tables in a database is authorized as "database name. *", A table for a database is authorized as the database name. Table name.
Andy indicates which user you want to authorize, the user can be a user who exists, or it can be a non-existent user.
192.168.1.100 represents the IP address that allows remote connections, or "%" if you want to limit the IP of the link.
123456 is the user's password.
After executing the above statement, execute the following statement before it can take effect immediately.
> Flush privileges;
2, Local computer (IP:192.168.1.100):
EXECUTE as follows:./mysql-h 192.168.1.244-u andy-p 123456
Shown below:
Forwarding Please specify the source: http://www.cnblogs.com/fnlingnzb-learner/p/5830661.html
Remote connection for MySQL under Linux