mentioned above
CentOS7 default does not support MySQL, using yum install MySQL installation is mariadb,mariadb MySQL is an open source branch, so we need to configure a new Yum source for MySQL installation
Operation
Step 1: Download the yum source to install MySQL (version selected here 5.7)
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Yum localinstall mysql57-community-release-el7-8. noarch.rpm
Step 2: Clean up the Yum cache:
Yum clean all && yum makecache
Step 3: Install the appropriate packages as needed
Yum -y install mysql-community-client # Client
Yum -y install mysql-community-server # Server
Yum -y install mysql-community-devel # Development Library
Step 4: Start the MySQL service and need to install the server Mysql-community-server
systemctl start mysqld
Step 5: Set the root user password, the default password is empty, command line directly hit MySQL can connect
mysqladmin-u root Password "newpass"
If prompted: mysqladmin:unable to change password; Error: ' Column count of Mysql.user is wrong. expected, found 42. Created with MySQL 50556, now running 50722. Please use the Mysql_upgrade to fix this error. '
Execution: Mysql_upgrade
Step 6: Connect to MySQL
mysql-u Root-pnewpass # Note There can be no spaces after-p
Installation and configuration of MySQL under CentOS7