# Recommended: "Linux mysql2003 error solution: first enter the mysql directory; then open the my.cnf file, find "bind-address = 127.0.0.1", and add the "#" symbol in front; finally add "kip -external..." code is enough.
mysql video tutorial》
Not much to say, just go to the code
1. Enter in the console and enter the mysql directory,
sudo su //进入root权限cd /etc/mysql
2. Open my. cnf file, find bind-address = 127.0.0.1 and comment it out with # in front, as follows: #bind-address = 127.0.0.1
3. Then add the following code; OK .
skip-external-lockingskip-name-resolve
Then enter the second path /etc Open the mysqld.cnf file in the /mysql/mysql.conf.d/ folder and modify it.
4. Restart the mysql service
service mysql restart
3. Enter update user set host='%' where user=' root' ; to allow access through IP.) Note: The method in brackets allows everyone to connect, which is easy to be hacked by others, so you need to set up designated IP access. The specific method is as follows:
Directly enter:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'要指定的IP地址' IDENTIFIED BY '设置的密码' WITH GRANT OPTION;
4. Continue to enter flush privileges; Remember, no matter which method you choose above, you must perform this step to update the database user permissions. Very important! ! !
5. Then reconnect and the problem will be solved.
The above is the detailed content of How to solve linux mysql2003 error. For more information, please follow other related articles on the PHP Chinese website!