These two days in a database project, using MySQL, the need to remote access to MySQL through the external IP, found that the default MySQL is not allowed remote access, need to do a simple configuration.
As follows:
1. Open a terminal (CMD) input
Mysql-u User name-p password
# (if there is no MySQL command, you go to the MySQL bin directory to execute)
2. Assigning Permissions:
Grant all privileges on * * to ' login name ' @ '% ' identified by ' login password ';
#说明 here is simply to say that all permissions are assigned to all external IP access, but this is not in accordance with the security principle, but can solve the problem.
# ' login name ' @ '% ' means login to this MySQL username,% refers to any IP, if just specify a specific IP directly to write IP. such as 192.168.1.111
3. Refresh Permissions
Flush privileges;
Configure MySQL to allow external IPs to log on