Scene:
Several people develop a project as a team, with my machine as the server, the MySQL service installed on my machine, other small partners with the client can access my database
Solve:
First of all:
1. Set MySQL to allow other machine connections (Linux environment, this setting is required, different versions of Windows require selective modification can be)
#vi/etc/mysql/my.cnf
Comment out the bind-address=127.0.0.1, the front plus #
2. Authorize other machine operation database (Quite important)
Go to MySQL command line operation
Mysql-uRoot-P123456(123456 is password)
Mysql>grant all privileges the database name . * to [email protected]"%" identified by "123456"; 123456 is password
The database name is modified based on the actual database name accessed, or you can set all databases with * instead of
So that the other machines can access the specified database.