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 allow public network access in mysql

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

Share

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

How to allow public network access in mysql? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

1. Modify the table, log in to the mysql database, switch to the mysql database, and use the SQL statement to view "select host,user from user;"

Mysql-u root-pvmwaremysql > use mysql;mysql > update user set host ='% 'where user =' root';mysql > select host, user from user;mysql > flush privileges

Note: the last sentence is important in order to make the changes effective. If you don't write, you still can't make a remote connection.

2, authorized user, you want root to connect to the mysql server from any host with a password

GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' admin123' WITH GRANT OPTION;flush privileges

If you want to allow the user root to connect to the mysql server from the host with an ip of 192.168.1.104

GRANT ALL PRIVILEGES ON *. * TO 'myuser'@'192.168.1.104' IDENTIFIED BY' admin123' WITH GRANT OPTION;flush privileges

Modify MySql password

The password field in MySQL 5.7 has been removed from the mysql.user table with the new field name "authenticalion_string".

Select the database:

Use mysql

Update the password for root:

Update user set authentication_string=password ('new password') where user='root' and Host='localhost'

Refresh permissions:

This is the answer to flush privileges; 's question on how to allow public network access in mysql. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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