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 access the public network in MySQL

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

Share

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

Today, I will talk to you about how to achieve public network access in MySQL. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

Set MySQL to allow public network access

1. Modify the configuration file (this may not be set under windows)

Sudo vim / etc/mysql/my.cnf

Change the value of the bind-address parameter to your intranet IP or 0.0.0.0, or comment out the line directly.

two。 Log into the database

Mysql-u root-p

Enter password

Mysql > use mysql

3. Query host

Mysql > select user,host from user

4. Create host

If there is no host value of "%", execute the following two sentences:

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

Mysql > flush privileges

5. Authorized user

Any host connects to the mysql server with user root and password mypwd

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' 123456 'WITH GRANT OPTION

Mysql > flush privileges

The host with IP 10.39.5.74 connects to the mysql server with user root and password 123456

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'10.39.5.74' IDENTIFIED BY' 123456 'WITH GRANT OPTION

Mysql > flush privileges

After reading the above, do you have any further understanding of how to access the public network in MySQL? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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