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

Set the detailed process sharing for Mysql5.6 to allow public network access

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

Share

Shulou(Shulou.com)06/01 Report--

When mysql5.6 is recently deployed, it is found that the default mysql only allows local services to be provided. If you want to make several configurations, record as follows.

1. Set the MySQL service to allow access to the public network

Modify the configuration files of mysql, either my.ini (windows) or my.cnf (linux)

Add to the configuration file

[mysqld] port=3306bind-address=0.0.0.0

Then restart the mysql service and execute service mysql restart.

2. Set mysql users to support public network access

You need to log in to mysql with root permission, update the mysql.user table, and set the Host field for the specified user to%. The default is 127.0.0.1 or localhost.

1. Log into the database

Mysql-u root-p

Enter password

Mysql > use mysql

two。 Query host

Mysql > select user,host from user

3. 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

4. Authorized user

(1) any host connects to the mysql server with user root and password mypwd

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' mypwd' WITH GRANT OPTION;mysql > flush privileges

(2) the host with IP 192.168.133.128 connects to the mysql server with user myuser and password mypwd

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'myuser'@'192.168.133.128' IDENTIFIED BY' mypwd' WITH GRANT OPTION; mysql > flush privileges

[host field description]

Allow login from any ip x.x.x.x allow access from the specified ip

The detailed flow sharing of setting up Mysql5.6 to allow public network access is all the content shared by the editor to you. I hope I can give you a reference and support it.

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