CentOS7.5 installation tutorial of MySQL

CentOS7.5 installation tutorial of MySQL

1. First check whether the system has mysql installed

rpm -qa | grep mysql

2. Download the mysql repo source (5.7)

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

If the error is: -bash: wget: command not found

Install the plugin   yum -y install wget

3. Install mysql-community-release-el7-5.noarch.rpm package

sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm

4. Install MySQL

sudo yum install mysql-server

5. Reset MySQL password

Check the running status of MySQL, as shown in the figure:

systemctl status mysqld.service

At this point, MySQL has started running normally, but to enter MySQL, you must first find out the password of the root user. You can find the password in the log file using the following command:

grep "password" /var/log/mysqld.log

Enter the database using the following command:

mysql -uroot -p

Enter the initial password (Es9akjRtrd<4 at the end of the picture above). You cannot do anything at this time because MySQL requires you to change the password before you can operate the database:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

Replace 'new password' with the password you want to set. Note: The password must contain uppercase and lowercase letters, numbers, and special symbols (,/';:, etc.), otherwise the configuration will fail.

6. Restart MySQL service

service mysqld restart

Then set the remote connection password for the Root account. Both the account and password are root.

 mysql -u root -p

GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY " your password ";

Restart the server

service mysqld restart

7. Use external network tools to connect to MySQL

The username and password to connect to mysql are both root

Turn off firewall

systemctl stop firewalld.service

This is the end of this article about installing MySql on CentOS7.5. For more information about installing MySql on CentOS7.5, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions
  • CentOS7.5 uses mysql_multi to install MySQL5.7.28 multiple instances (detailed explanation)
  • Centos7.5 installs mysql5.7.24 binary package deployment

<<:  Let's learn about JavaScript object-oriented

>>:  How to use MySQL group by and order by together

Recommend

Q&A: Differences between XML and HTML

Q: I don’t know what is the difference between xml...

How to build a tomcat image based on Dockerfile

Dockerfile is a file used to build a docker image...

JavaScript drag time drag case detailed explanation

Table of contents DragEvent Interface DataTransfe...

Detailed process of building nfs server using Docker's NFS-Ganesha image

Table of contents 1. Introduction to NFS-Ganesha ...

Summary of MySQL 8.0 Online DDL Quick Column Addition

Table of contents Problem Description Historical ...

Implementing a web calculator with native JavaScript

This article shares the specific code of JavaScri...

Parsing MySQL binlog

Table of contents 1. Introduction to binlog 2. Bi...

How to use Samba to build a shared file service on a Linux server

Recently, our small team needs to share a shared ...

MySQL sharding details

1. Business scenario introduction Suppose there i...

Automatically log out inactive users after login timeout in Linux

Method 1: Modify the .bashrc or .bash_profile fil...

React implements multi-component value transfer function through conetxt

The effect of this function is similar to vue的pro...

Detailed steps for manually configuring the IP address in Linux

Table of contents 1. Enter the network card confi...

Vue implements DingTalk's attendance calendar

This article shares the specific code of Vue to i...

Use h1, h2, and h3 tags appropriately

In the process of making web pages, it is inevita...