Enable remote access rights for mysql By default, MySQL users do not have remote access permissions, so when the program and the database are not on the same server, we need to enable remote access permissions for MySQL. There are two mainstream methods, the table modification method and the authorization method. Relatively speaking, the table modification method is easier, and I personally prefer this method. Therefore, I will only post the table modification method here. 1. Log in to MySQL mysql -u root -p 2. Modify the user table of the MySQL database and change the host item from localhost to %. %This means that any host is allowed to access. If only a certain IP is allowed to access, you can change it to the corresponding IP. For example, you can change localhost to 192.168.1.123, which means that only the IP 192.168.1.123 in the local area network is allowed to remotely access MySQL. mysql> use mysql; mysql> update user set host = '%' where user = 'root'; mysql> select host, user from user; mysql> flush privileges; Open port 3306 on the firewall Summarize The above is what I introduced to you about modifying the permissions allowed by MySQL to allow hosts to access. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of log processing of Docker containers
>>: express project file directory description and detailed function description
The difference between http and https is For some...
I was recently working on a project at the compan...
Preface Nginx (pronounced "engine X") i...
Table of contents Preface Basic Concepts of Argum...
Summary HTML: element plus v-cloak CSS: [v-cloak]...
1. Installation process MySQL version: 5.7.18 1. ...
Recently, Docker image pull is very unstable. It ...
environment Linux 3.10.0-693.el7.x86_64 Docker ve...
To set the line spacing of <p></p>, us...
Preface I believe that everyone has been developi...
background: The site is separated from the front ...
1. The as keyword indicates an assertion In Types...
I haven't used mysql on my computer for a lon...
1. Environmental Preparation Tencent Cloud Server...
Since I need to learn how to build servers and da...