Installation and configuration of MySQL under CentOS7

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.