Problem: MySQL can only connect with localhost or 127.0.0.1
FIX: After MySQL installs, the default is root user, root user can only log on the server, need to assign new user.
1. Log in to the MySQL database as the root user.
2. Execute a command to assign a new user:
Grant all privileges on * * to ' username ' @ ' IP address ' identified by ' password ';
' All privileges ': All permissions can also be written as SELECT, UPDATE, etc.
* * All tables for all libraries, such as databasename.*.
IP where the IP database resides.
Identified by ' Password ' means a password connection.
3. After executing the above command, use the following command to refresh the permissions
Flush privileges;
4. Modify the my.conf configuration
[Mysqld] ... bind_address=127.0.0.1 # shield off the place ...
5. Restart MySQL
5.1. Start: Enter net stop MySQL
5.2. Stop: Enter net start MySQL
Cannot restart (restart) MySQL directly, can only stop, then start.