Linux configure Mysql to allow remote access

The operation is very simple, on the 5 step, as follows:

1.login mysql :

>mysql -uroot -p;

2.Using mysql database:

>use mysql;

3.View user table :

>SELECT Host,User FROM user;
+--------------+------+-------------------------------------------+
| host         | user | password                                  |
+--------------+------+-------------------------------------------+
| localhost    | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
| 192.168.1.1  | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
+--------------+------+-------------------------------------------+

4.Update user table :

>UPDATE user SET Host = '%' WHERE User = 'root' LIMIT 1;
('%' is allow all the IP remote access, if you need to a specific IP can be written on the specific IP)

5.Force refresh privileges :

>flush privileges;

Completion of the above steps can be remotely connected to the database, the last one is key sql statement

Pingbacks are closed.

Comments are closed.