Home > Database > Mysql Tutorial > body text

How to allow external network access settings in Mysql

coldplay.xixi
Release: 2020-09-30 13:35:01
Original
5976 people have browsed it

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;
Copy after login

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;
Copy after login

(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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template