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

Have you really learned MySQL connection query?

1. Inner Join Query Overview Inner join is a very...

js native waterfall flow plug-in production

This article shares the specific code of the js n...

The difference between clientWidth, offsetWidth, scrollWidth in JavaScript

1. Concept They are all attributes of Element, in...

Example of implementing load balancing with Nginx+SpringBoot

Introduction to Load Balancing Before introducing...

Sample code for modifying the input prompt text style in html

On many websites, we have seen the input box disp...

Docker renames the image name and TAG operation

When using docker images, images with both REPOSI...

Mini Program Custom TabBar Component Encapsulation

This article example shares the specific code for...

The difference between animation and transition

The difference between CSS3 animation and JS anim...

Talk about implicit conversion in MySQL

In the course of work, you will encounter many ca...

Advertising skills in the Baidu Union environment (graphic tutorial)

Recently, students from the User Experience Team o...

CSS3 to achieve timeline effects

Recently, when I turned on my computer, I saw tha...

Vue practice of preventing multiple clicks

Generally, click events will be divided into diff...