---Start restoring content---
Mysql has two methods to solve the problem of remote access. Friends who need it can refer to it:
1. In /etc/ Comment out bind-address = 127.0.0.1
in the [mysqld] section of mysql/my.cnf. 2. Use mysql -uroot -p to log in to mysql, and then use the following method to enable remote access:
Method 1: mysql>use mysql;
mysql>update user set host = '%' where user = 'root'; mysql>FLUSH RIVILEGES;
Method 2:
mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
---End of recovery content---
The above is the detailed content of MySQL uses two methods to solve the problem of remote connection failure. For more information, please follow other related articles on the PHP Chinese website!