An example of installing MySQL on Linux and configuring external network access

An example of installing MySQL on Linux and configuring external network access

Configuration steps

1. Check whether DNS is configured

If DNS is not configured, refer to the previous article to configure DNS

Configuration related

If DNS is not configured, the yum command cannot find the DNS configuration of the Linux software library. The free DNS1=114.114.114.114 can be used. You can also add a backup DNS2=119.29.29.29

2. Install mysql with yum

yum -y install mysql mysql-server mysql-dev

Here, yum is used to perform the -y consent operation. The following three software are mysql, mysql-server, and mysql-dev in an irrelevant order.

3. Start the mysql service

service mysqld start

The service needs to be started here, otherwise subsequent operations cannot be performed

4. Configure MySQL default password

mysqladmin -u root password 'xxxxx'

Configure the root password. Generally, many external software cannot access the root password if it is not configured.

5. Configure external network access

The default root user login command is mysql -u root -p

mysql -p (Beginners are advised to practice with the full name of the command, because if you log in with the abbreviated command after work, the default user is root. If there is an error operation, it will bring unexpected results!!!)

use mysql; 
update user set host='%' where user='root' and host='localhost';

6. Update permissions

flush privileges; 
exit;

The user table cannot be updated without updating permissions

7. Configure Firewall

service iptables stop 
chkconfig iptables off

The firewall has an IP ban table, and except for port 22, all other ports are blocked by default.

8. Configure the MySQL service to start automatically

chkconfig mysqld on

Set the mysql service to start automatically at boot

The above configuration firewall

9. That’s it. Try accessing it from the Internet.

Final Thoughts

You must practice more to configure MySQL and become familiar with the operation. Practice more than 3 times a day.

The above example of installing MySQL in Linux and configuring 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 open external network access rights for mysql
  • Sharing the detailed process of setting up Mysql5.6 to allow external network access
  • Mysql allows external network access settings steps
  • How to allow external network access to mysql and modify mysql account password

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

>>:  JavaScript's unreliable undefined

Recommend

HTML table markup tutorial (5): light border color attribute BORDERCOLORLIGHT

In a table, you can define the color of the upper...

Best Practices Guide for MySQL Partitioned Tables

Preface: Partitioning is a table design pattern. ...

Docker sets up port mapping, but cannot access the solution

#docker ps check, all ports are mapped CONTAINER ...

3 Tips You Must Know When Learning JavaScript

Table of contents 1. The magical extension operat...

MySQL lock control concurrency method

Table of contents Preface 1. Optimistic Locking A...

Detailed tutorial on installation and configuration of nginx under Centos7

Note: The basic directory path for software insta...

Example of how to set up a Linux system to automatically run a script at startup

Preface Hello everyone, I am Liang Xu. At work, w...

Detailed explanation of system input and output management in Linux

Management of input and output in the system 1. U...

MySQL database deletes duplicate data and only retains one method instance

1. Problem introduction Assume a scenario where a...

Detailed explanation of firewall rule settings and commands (whitelist settings)

1. Set firewall rules Example 1: Expose port 8080...

HTML is actually the application of learning several important tags

After the article "This Will Be a Revolution&...

MySQL uses UNIQUE to implement non-duplicate data insertion

SQL UNIQUE constraint The UNIQUE constraint uniqu...

Detailed explanation of MySql view trigger stored procedure

view: When a temporary table is used repeatedly, ...

Example code for implementing dynamic skinning with vue+element

Sometimes the theme of a project cannot satisfy e...