Home  >  Article  >  Database  >  How to allow external network access settings in Mysql

How to allow external network access settings in Mysql

coldplay.xixi
coldplay.xixiOriginal
2020-09-30 13:35:015959browse

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

How to allow external network access settings in Mysql

Mysql allows external network access settings:

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

2. Enter: use mysql;

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

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

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

mysql> update user set host='%' where user='root';
mysql> flush privileges;

5. Authorized user

(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) The host with the specified IP (such as 192.168.1.100) connects 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;

More related free learning recommendations:mysql tutorial(Video)

The above is the detailed content of How to allow external network access settings in Mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn