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

How to install OpenSuse on virtualbox

The virtual machine is installed on the host mach...

Practice of realizing Echarts chart width and height adaptation in Vue

Table of contents 1. Install and import 2. Define...

How to quickly insert 10 million records into MySQL

I heard that there is an interview question: How ...

How to set the memory size of Docker tomcat

When installing Tomcat in Docker, Tomcat may over...

How to implement page jump in Vue project

Table of contents 1. Create a vue-cli default pro...

What should I do if I can't view the source file of a web page?

Q: Whether using Outlook or IE, when you right-cl...

How to make your JavaScript functions more elegant

Table of contents Object parameters using destruc...

A brief discussion on spaces and blank lines in HTML code

All consecutive spaces or blank lines (newlines) ...

Centering the Form in HTML

I once encountered an assignment where I was give...

Some settings of Div about border and transparency

frame: Style=”border-style:solid;border-width:5px;...

Detailed installation tutorial of mysql 5.7.11 under Win7 system

Operating system: Win7 64-bit Ultimate Edition My...

Parsing the commonly used v-instructions in vue.js

Table of contents Explanation of v-text on if for...

Some ways to eliminate duplicate rows in MySQL

SQL statement /* Some methods of eliminating dupl...