Http://database.51cto.com/art/201005/202022.htm
The followingArticleThis article mainly introduces the actual operation process for implementing MySQL remote access, as well as the related matters during the implementation of MySQL remote access, the following describes the specific content of the article. I hope you will have a better understanding of it after browsing.
MySQL remote access:
1. Change the table method. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to MySQL on the computer of localhost, and change the "host" entry in the "user" table in the "MySQL" database to "%" from "localhost"
- Mysql-u root-pvmwaremysql>Use MySQL;
- MySQL>Update user setHost='%'WhereUser='Root';
- MySQL>Select host, user from user;
2. Authorization law. For example, if you want myuser to use mypassword to connect to the MySQL server from any host.
- Grant all privileges on *. * To 'myuser' @ '%' identified by 'mypassword' wi
- Th grant option;
In MySQL remote access, if you want to allow myuser to connect to the MySQL server from a host with IP address 192.168.1.6, and use mypassword as the password
- Grant all privileges on *. * To 'myuser' @ '192. 168.1.3 'identified
- 'Mypassword' with grant option;
I used the first method. I first found that it could not work. I checked it online and executed one less statement mysql> flush rivileges.
Make the modification take effect.
Another method:
Run the following command on the machine where MySQL is installed:
1. D: \ mysql \ bin \> mysql-H localhost-u Root
In this way, you can access the MySQL server.
2. mysql> grant all privileges on *. * To 'root' @ '%' with grant option
Grant data access permissions to any host
3. mysql> flush privileges
Modification takes effect
4. mysql> exit
Log out of the MySQL server
In this way, you can log on to any other host as the root user.
The above content is an introduction to MySQL remote access. I hope you will get some benefits.