CentOS6, 7 installation MySQL5.7 full tutorial

Source: Internet
Author: User
Tags gpg

CentOS6, 7 installation MySQL5.7 full tutorial

Do development always use the data bar, Linux as a server, there must be a database to store test data, so, here is attached CentOS6, 7 installation MySQL5.7 Tutorial Oh ~

Tools used: CENTOS6, 7;mysql dependency Packages

Step1. to view the installed MySQL:

Yum grep mysqlmysql-libs.x86_64       5.1.  1. el6    @anaconda-centos-201311272149. x86_64/6.5

Uninstall current MySQL:

Yum -y remove mysql-libs.x86_64

Step2. dependencies required to download the installation:

First to https://dev.mysql.com/downloads/repo/yum/ Download, according to their own Linux version to choose, such as I am Centos6.5, so choose the second, and so on :

Upload the downloaded mysql80-community-release-el6-1.noarch.rpm file to the Linux server

Step3. Installation dependencies:

use the following command, Note This command needs to be executed in the directory where the mysql80-community-release-el6-1.noarch.rpm file is located.

The is this OK [y/n] will appear during execution: Enter y on the line.

Yum localinstall mysql80-community-release-el6-1. noarch.rpm

After execution, use the # LS/ETC/YUM.REPOS.D command to see two more files

ls /etc/yum. Repos.dmysql-community.repo        Mysql-community-source.repo

Step4. Run Yum repolist enabled | grep MySQL See if mysql57 is available.

If you run the following results:

Yum grep mysqlmysql-connectors-community           mysql connectors community              MySQL- Tools-community                MySQL Tools Community                   mysql80-community                    8.0 Community Server              

You need to use the command Vim/etc/yum.repos.d/mysql-community.repo to modify the mysql57 's enabled to 1, while the other version is set to 0. The following:

vim/etc/Yum. Repos.d/mysql-community.repo

Modification section:

... # Enable to use MySQL5.7[mysql57-Community]name=mysql5.7Community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/Enabled=1Gpgcheck=1Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-mysql ...... [Mysql80-Community]name=mysql8.0Community Serverbaseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/Enabled=0Gpgcheck=1Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-mysql

The results of the setup run are:

Yum grep mysqlmysql-connectors-community           mysql connectors community              MySQL- Tools-community                MySQL Tools Community                   mysql57-community                    5.7 Community Server             273

Step5. To start the installation:

Yum Install Mysql-community-server

If the error stops halfway, it is generally because of the speed of the network, you can repeat this command

Step6. When the installation is complete, start the MySQL service (you may get an error the first time, then run it again ~):

# service Mysqld startinitializing MySQL database:  [failed]# service mysqld startstarting mysqld:  [  OK  ]

STEP7. To view the password for the default root user:

Cat grep [email protected] 2018--29t03: All:1 for [email protected]: dj#era*-p6&?

Dj#era*-p6&? Is The root user's initial password

STEP8. To log in using the Mysql-uroot-p command, you need to enter the password in the previous step.

Any action after entering will prompt for ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statem Ent. You will need to reset your password at this time:

Mysql>show databases; ERROR1820(HY000): You must reset your password usingALTER USERstatement before executing this statement.mysql> SetPassword=Password'New_password'); Query OK,0Rows affected,1Warning (0.01sec) MySQL> Alter User 'Root'@'localhost'password expire never; Query OK,0Rows Affected (0.00sec) MySQL>FlushPrivileges; Query OK,0Rows Affected (0.00Sec

Quit MySQL again and log in again with your new password.

How, is not hin simple, what questions please leave your comments Oh ~

CentOS6, 7 installation MySQL5.7 full tutorial

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.