MariaDB is installed by default in CentOS, which is a branch of MySQL. However, for the sake of need, MySQL still needs to be installed in the system, and MariaDB can be directly overwritten after the installation is complete. 1 Download and install the official MySQL Yum Repository [root@localhost ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm Use the above command to directly download the Yum Repository for installation, which is about 25KB, and then you can directly install it with yum. [root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm After that, start installing the MySQL server. [root@localhost ~]# yum -y install mysql-community-server This step may take some time, and once the installation is complete it will overwrite the previous mariadb. 2 MySQL Database Settings First start MySQL [root@localhost ~]# systemctl start mysqld.service Check the running status of MySQL, as shown in the figure: [root@localhost ~]# 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: [root@localhost ~]# grep "password" /var/log/mysqld.log Enter the database using the following command: [root@localhost ~]# mysql -uroot -p Enter the initial password. You cannot do anything at this time because MySQL requires you to change the password by default before you can operate the database: mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password'; Password setting 12 digits There is a problem here. If the new password is set too simply, an error will be reported: The reason is that MySQL has password setting specifications, which are specifically related to the value of Once you have set your password, you are done. Summarize The above is a detailed tutorial on how to install MySQL 5.7.26 on centOS7.4. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of TypeScript 2.0 marked union types
>>: MySQL database SELECT query expression analysis
Preface: I wrote this because I helped my friend ...
Adding indexes can improve query efficiency. Addi...
Putting input and img on the same line, the img ta...
There are two ways to disable form submission in ...
1. The vertical-align property achieves the follo...
When shutting down the MySQL server, various prob...
Table of contents Preface What is metadata Refere...
I have previously written an article about file t...
The reason is this I wanted to deploy a mocker pl...
Create a Directory cd /usr/local/docker/ mkdir je...
1. Installation Tip: There is currently no offici...
Table of contents 1.Json string 1.1Json Syntax 1....
Table of contents 01 Problem Description 02 Solut...
Table of contents Preface Actual Combat 1. No loc...
Table of contents Introduction to frm files and i...