Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that mysql can connect locally but other computers fail to connect?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "mysql can be connected to the local computer but other computer connection failure how to solve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "mysql native computer can connect but other computer connection failure how to solve" bar!

one. Change the meter. It may be that your account is not allowed to log in remotely, only in localhost. At this time, as long as on the computer in localhost, after logging in to mysql, change the "host" entry in the "user" table in the "mysql" database from "localhost" to "%"

Mysql-u root-pvmwaremysql > use mysql

Mysql > update user set host ='% 'where user =' root'

Mysql > select host, user from user

two。 Authorization law. For example, if you want myuser to connect to the mysql server from any host using mypassword.

GRANT ALL PRIVILEGES ON *. * TO IDENTIFIED BY 'mypassword' WITH GRANT OPTION

FLUSH PRIVILEGES

If you want to allow the user myuser to connect to the mysql server from the host with ip 192.168.1.6, and use mypassword as the password

GRANT ALL PRIVILEGES ON *. * TO IDENTIFIED BY 'mypassword' WITH GRANT OPTION

FLUSH PRIVILEGES

The first method I used found that it didn't work at first. I looked it up on the Internet and executed one less sentence, mysql > FLUSH PRIVILEGES.

Put the changes into effect. That's it.

Open remote connection permissions for Mysql database:

Grant all privileges on *. * to 'root' @'% 'identified by' wrx123'

Flush privileges

Open a remote connection to mysql

Change your HOST field to%, which means that anyone with any address can log in with this account, or you can also click IP

Mysql > GRANT ALL on *. * to identified by "456"

Thank you for your reading, the above is the content of "mysql native machine can connect but other computer connection failure how to solve", after the study of this article, I believe you can connect mysql native computer but other computer connection failure how to solve this problem has a deeper experience, the specific use of the need for everyone to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report