First, install MySQL. This should not be said much.
Then confirm that My.ini,linux is my.cnf. There is no skip-networking in the document, or the sentence is annotated. Now it seems to be installed after the default is not. (if modified, restart MySQL after modification)
SQL code
The code is as follows |
Copy Code |
mysql> use MySQL; Mysql> Grant all on *.* to admin@ '% ' identified by ' admin ' with GRANT OPTION; #这句话的意思, the computer that allows any IP address (above%) to access this MySQL Server with the admin account and password (admin) #必须加类似这样的帐户 before you can log in remotely. The root account cannot be logged in remotely, it can only be logged locally mysql> use MySQL; Mysql> Grant all on *.* to admin@ '% ' identified by ' admin ' with GRANT OPTION; #这句话的意思, the computer that allows any IP address (above%) to access this MySQL Server with the admin account and password (admin) #必须加类似这样的帐户 before you can log in remotely. The root account cannot be logged in remotely, it can only be logged locally |
or directly increase the fixed IP user
Then add the MySQL user. The specific code is as follows:
The code is as follows |
Copy Code |
--*.* represents permissions. Remote indicates the user name, password represents the password --172.16.21.39 indicates that the remote address, if used%, means that it can be accessed at any address GRANT all on *.* to ' remote ' @ ' 172.16.21.39 ' identified by ' password '; --Set remote to access test database at any address GRANT all on test.* to ' remote ' @ '% ' identified by ' password '; |
At this point, MySQL has been configured, and then to check the firewall, last time I was a firewall toss a morning. Turn on the firewall's 3306 (MySQL port) on the line.