Sharing the detailed process of setting up Mysql5.6 to allow external network access

Sharing the detailed process of setting up Mysql5.6 to allow external network access

I recently deployed MySQL 5.6 and found that by default MySQL only allows local services. If you want to make some configurations, please record them as follows.

1. Set up MySQL service to allow external network access

Modify the mysql configuration file, some are my.ini (windows), some are my.cnf (linux),

Add in the configuration file

[mysqld]
port=3306
bind-address=0.0.0.0

Then restart the MySQL service and execute service mysql restart.

2. Set up MySQL users to support external network access

You need to log in to MySQL with root privileges, update the mysql.user table, and set the Host field of the specified user to %. The default is generally 127.0.0.1 or localhost.

1. Log in to the database

mysql -u root -p

Enter password

mysql> use mysql;

2. Query host

mysql> select user,host from user;

3. Create a host

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

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

4. Authorized Users

(1) Any host connects to the MySQL server as user root and password mypwd

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

(2) The host with IP address 192.168.133.128 connects to the MySQL server as user myuser and password mypwd

mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.133.128' IDENTIFIED BY 'mypwd' WITH GRANT OPTION; 
mysql> flush privileges;

【Host field description】

% Allow login from any IP address xxxx Allow access from specified IP address

The above detailed process of setting up Mysql5.6 to allow external network access is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • How to set up to allow external network access to MySQL
  • Mysql allows external network access settings steps
  • How to open external network access rights for mysql
  • How to set up MySQL to allow external network access
  • The whole process of Mysql opening external network access

<<:  Installation and deployment of Linux tool Nethogs to monitor network bandwidth by process

>>:  How to run sudo command without entering password in Linux

Recommend

Teach you how to implement a react from html

What is React React is a simple javascript UI lib...

MySQL merge and split by specified characters example tutorial

Preface Merging or splitting by specified charact...

How to install JDK 13 in Linux environment using compressed package

What is JDK? Well, if you don't know this que...

Summary of CSS gradient effects (linear-gradient and radial-gradient)

Linear-gradient background-image: linear-gradient...

Detailed explanation of overflow-scrolling to solve scrolling lag problem

Preface If you use the overflow: scroll attribute...

Detailed process of installing Presto and connecting Hive in Docker

1. Introduction Presto is an open source distribu...

In-depth understanding of Vue's data responsiveness

Table of contents 1. ES syntax getter and setter ...

How to Easily Remove Source Installed Packages in Linux

Step 1: Install Stow In this example, we are usin...

Nginx reverse proxy forwards port 80 requests to 8080

Let's first understand a wave of concepts, wh...

The best explanation of HTTPS

Good morning everyone, I haven’t updated my artic...

Steps to enable TLS in Docker for secure configuration

Preface I had previously enabled Docker's 237...

How to find and delete duplicate rows in MySQL

Table of contents 1. How to find duplicate rows 2...