Get the App
SLTechnology News&Howtos  ›  Database  › 

How to set up Mysql to allow public network access

Shulou Source: shulou.com Published: 2022-06-01 02:54:26 09月12日 Update

This article mainly introduces how to set up Mysql to allow external network access, which has a certain reference value, and friends who need it can refer to it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Mysql allows the public network to access the settings: first open mysql to enter the password and enter [use mysql]; then create a host and authorize the user; finally, connect to the mysql server with the user root and password pwd.

Mysql allows public network to access settings:

1. Open mysql.exe (MySQL Command Line Client) and enter the password

2. Input: use mysql

3. Query host input: select user,host from user

4. Create a host (skip this step if there is a host value of "%")

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 users

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

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

(2) specify a host with an IP (such as 192.168.1.100) to connect to the mysql server with user tuser and password tpwd

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'tuser'@'192.168.1.100' IDENTIFIED BY' tpwd' WITH GRANT OPTION; mysql > flush privileges; Thank you for reading this article carefully. I hope it will be helpful for everyone to share how to set up Mysql to allow external network access. At the same time, I also hope you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

Tags: Password user input method server article service host value content at the same time friend ribbon industry information information channel question channel reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft vpn Redmi Docker