Detailed explanation on Linux system authorization for MySQL external network access

黄舟
Release: 2017-05-31 11:26:49
Original
2299 people have browsed it

Problem phenomenon


MySQL Unable to connect through the external network.

Cause of the problem


Execute in the bin directory of MySQL:

Log in to the data

mysql -uroot -p密码
Copy after login
use mysql;
select host,user,password from user;
Copy after login

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.

Solution


Execute the following command:

update user set host='%' where user ='root';
flush privileges;
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!