1. Remote database access model 2. How to Set MySQL on WIN7 and Linux: 2.1. Assign permissions (Linux and WIN7) for MySQL command lines, assign permissions, and execute GRANTALLPRIVILEGESON *. * TO 'Lucy '@' 192. 168.1.102 'identifiedby '123' WITHGRANTOPTION; ALLPRIVILEGES allocation
1. approximate model of remote database access
2. How to configure MySQL in Windows 7 and Linux:
2.1. Assign permissions (Linux and WIN 7)
Execute the MySQL command line to assign permissions and execute
Grant all privileges on *. * TO 'Lucy '@ '192. 168.1.102' identified by '20140901' with grant option;
All privileges assigns ALL permissions, such as Select, Insert, Delete, Update, Drop, and Create.
*. * It is a table in the database. database.
'Lucy 'is the username required by the remote host to access the computer. (mysql assigns the user to the remote host. Of course, you must use port 3306 in the following step)
'192. 168.1.102 'is the IP address of the remote host (which IP address of the remote host can be accessed by mysql)
'000000' indicates the user password that the remote host knows and needs to access (this is also the password allocated to the remote host by mysql)
Therefore, it can be summarized
Grant all privileges on database. database table TO 'remote machine Username '@ 'remote machine IP address' identified by 'remote machine user password' with grant option;
2.2 Open Port 3306
2.2.1 why port 3306 should be enabled?
Because of firewall problems, such:
After ASP is configured in IIS, the local area network host cannot access the webpage of the Local Machine (if the default port is 80), and you can turn off the firewall. Because port 80 is not enabled.
Mysql's default port 3306 is disabled by default.
2.2.2. Why do we not need to open a port when accessing SQL remotely?
Because the SQL port is opened by default, you only need to know its user name, password, and port number 1433 when you remotely access the SQL database.