Home  >  Article  >  Database  >  Let’s talk about how to enable remote access in mysql

Let’s talk about how to enable remote access in mysql

藏色散人
藏色散人forward
2022-01-21 16:54:286377browse

This article will introduce how to enable remote access in mysql. I hope it will be helpful to friends in need!

mysql enables remote access:

1. Open mysql server and set mysql access permissions

 mysql>grant all privileges on *.*  to  'root'@'%'  identified by 'youpassword'  with grant option;

Description: Root represents the user name. % represents all ip addresses, you can also set a specified ip address
2. After executing flush privileges;
3. Check the user table, you can see:
Let’s talk about how to enable remote access in mysql

host The value is %, which means that when the root user logs in to mysql, any IP can be allowed to access the mysql server.
4. If the mysql management tool navicat is used, the database cannot be connected and an error number (10038) is prompted;
Solution :
Command to open

vi  /etc/mysql/my.conf

Change

 bind-address = 127.0.0.1

to

bind-address = 0.0.0.0

and then restart mysql Server: service mysql restart;

Recommended learning: "mysql video tutorial"

The above is the detailed content of Let’s talk about how to enable remote access in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete