What should I do if mysql cannot be accessed from the external network?

coldplay.xixi
Release: 2023-01-03 09:27:16
Original
5509 people have browsed it

The solution to the problem that mysql cannot be accessed from the external network: First enter the mysql database and query the user; then execute [update user set host='%' where user ='root';] and execute refresh privileges [flush privileges] .

What should I do if mysql cannot be accessed from the external network?

The operating environment of this tutorial: Windows 7 system, mysql version 8.0.22, DELL G3 computer.

Solution to the problem that mysql cannot be accessed from the external network:

Perhaps sometimes you will access the database of the project through the IP address, but the access fails.

Now I give you a solution:

#进入mysql数据库 USE mysql;
Copy after login
#查询用户 SELECT HOST,USER,PASSWORD FROM USER;
Copy after login

You can see that if user is root and host is localhost,

It means that mysql only allows local connections, then the external network , the local software client cannot connect.

#调整方法: #执行: update user set host='%' where user ='root';
Copy after login
#执行刷新权限: flush privileges;
Copy after login

You can test the external network connection to the mysql server.

What should I do if mysql cannot be accessed from the external network?

Related free learning recommendations:mysql video tutorial

The above is the detailed content of What should I do if mysql cannot be accessed from the external network?. 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
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!