Home > Article > Operation and Maintenance > Detailed explanation on Linux system authorization for MySQL external network access
MySQL Unable to connect through the external network.
Execute in the bin directory of MySQL:
Log in to the data
mysql -uroot -p密码
use mysql; select host,user,password from user;
You can see If user is root and host is localhost, it means that MySQL only allows local connection, so external network and local software clients cannot connect.
Execute the following command:
update user set host='%' where user ='root'; flush privileges;
Check whether the modification is normal:
For the method of setting up remote connections for other users:
GRANT ALL PRIVILEGES ON 数据库名.* TO 账户@"%" IDENTIFIED BY "密码"; flush privileges;
You can test the external network connection to the MySQL server.
The above is the detailed content of Detailed explanation on Linux system authorization for MySQL external network access. For more information, please follow other related articles on the PHP Chinese website!