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

Five ways to achieve automatic page jump in HTML

In the previous article, we introduced three comm...

javascript implements web version of pinball game

The web pinball game implemented using javeScript...

Tips for writing concise React components

Table of contents Avoid using the spread operator...

Node+socket realizes simple chat room function

This article shares the specific code of node+soc...

Summary of several submission methods of HTML forms

The most common, most commonly used and most gener...

Some tips on deep optimization to improve website access speed

Some tips for deep optimization to improve websit...

Linux Cron scheduled execution of PHP code with parameters

1. Still use PHP script to execute. Command line ...

Tutorial on installing nginx in Linux environment

Table of contents 1. Install the required environ...

Introduction to the process of installing MySQL 8.0 in Linux environment

Table of contents Preface 1. Linux changes the yu...

Solution to VMware virtual machine no network

Table of contents 1. Problem Description 2. Probl...

Summary of Textarea line break issues in HTML

Recently, I encountered a problem of whether the d...

Solution to the inaccessibility of Tencent Cloud Server Tomcat port

I recently configured a server using Tencent Clou...

How to use html table (to show the visual effect of web page)

We know that when using HTML on NetEase Blog, we ...

Detailed explanation of Docker Swarm concepts and usage

Docker Swarm is a container cluster management se...