1. Open the cmd window and go to the MySQL installed bin directory
2. Execute the command to log in to the database, and a line will appear for you to enter the password
Mysql-u root-p
3. Execute the following command to assign a new user:
Grant all privileges on * * to ' username ' @ ' IP address ' identified by ' password ';
4. After executing the above command, refresh the permissions with the following command
Flush privileges;
5. Then turn off the MySQL service and start the MySQL service.
===================================================================================
This is a quick configuration method:
The account number is not allowed to log in remotely, only on localhost. This time, as long as the computer on the localhost, log in to MySQL, change the "MySQL" Database in the "User" table "host" item, from "localhost" to "%" or add a user as "%".
To allow all the machines on the LAN to connect to the MySQL database , start the remote connection for MySQL and execute the mysql command on the MySQL server console:
Grant all privileges on * * to [e-mail protected] "%" identified by ' ABC ' with GRANT option;
Flush privileges;
The above two lines of code means that the user named Root, which is connected from any IP address, is given all permissions by the user with the password of ABC. Where the "%" is any IP address, if you want to set a specific value can also be set to a specific value (the contents of the wildcard% increase the host/IP address, you can also directly increase the IP address).
After doing this, the MySQL server within the LAN can be accessed.
MySQL to turn on remote connectivity