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

How to hide a certain text in HTML?

Text hiding code, hide a certain text in HTML Copy...

The difference between div and span in HTML (commonalities and differences)

Common points: The DIV tag and SPAN tag treat som...

Mini Program natively implements left-slide drawer menu

Table of contents WXS Response Event Plan A Page ...

Introduction to JavaScript strict mode use strict

Table of contents 1. Overview 1.1 What is strict ...

A brief discussion on React native APP updates

Table of contents App Update Process Rough flow c...

How to use Docker to build a pypi private repository

1. Construction 1. Prepare htpasswd.txt file The ...

Mysql master-slave synchronization configuration scheme under Centos7 system

Preface Recently, when working on a high-availabi...

Detailed explanation of table return and index coverage examples in MySQL

Table of contents Index Type Index structure Nonc...

Solution to transparent font problem after turning on ClearType in IE

The solution to the transparent font problem after...

Specific usage of fullpage.js full screen scrolling

1.fullpage.js Download address https://github.com...

Complete steps to configure basic user authentication at the Nginx level

Preface Application scenario: probably the intern...

Simple method to install mysql under linux

When searching online for methods to install MySQ...

How to use ECharts in WeChat Mini Programs using uniapp

Today, we use uniapp to integrate Echarts to disp...