CentOS under RPM installation mysql5.7.13

Source: Internet
Author: User

1. View existing MySQL

Rpm-qa | grep MySQL

2. Uninstall

#yum-y-Remove mysql-libs-5.1.66-2.el6_3.x86_64

Check and delete the old version of MySQL development header files and libraries

command: #Rm-fr/usr/lib/mysql

#rm-fr/usr/include/mysql

Note: the data and /etc/my.cnf in/var/lib/mysql after uninstallation are not deleted, if determined, then manually deleted

#rm-F/ETC/MY.CNF

#rm-fr/var/lib/mysql

#rm-fr/usr/share/mysql

3. Install dependent packages

#yum-y install make gcc-c++ cmake bison-devel ncurses-devel Libaio libaio-devel

4.5.7.13 RPM installation package download

: Http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar

5. Decompression

#tar XVF Mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar

6. Installation

#rpm-IVH mysql-community-common-5.7.13-1.el6.x86_64.rpm

#rpm-IVH mysql-community-libs-5.7.13-1.el6.x86_64.rpm

#rpm-IVH mysql-community-client-5.7.13-1.el6.x86_64.rpm

#rpm-IVH mysql-community-server-5.7.13-1.el6.x86_64.rpm

7. Initialization

  in order to ensure that the database directory is the owner of the file with the MySQL login user, if you are running the MySQL service as root, you need to perform the following command initialization

#mysqld--initialize--user=mysql

  In addition , the--initialize option is initialized in "safe" mode by default, it generates a password for the root user and marks the password as expired, you need to set a new password after logging in, and use --initialize-insecure command does not use Safe mode, it does not Root The user generates a password, which is shown here using the --initialize initialized, which generates a root account password, the password in the log file.

#vim/var/log/mysqld.log

8. Start MySQL

#service mysqld Start

  

  #mysql-U root-p

Password for the password generated at the end of step 7

9. log in to MySQL and change the root password

  Msql>alter user ' root ' @ ' localhost ' identified by ' rootroot ';

Mysql>use MySQL;

Msyql>update user set user. host= '% ' where user. user= ' root ';

Mysql>flush privileges;

Mysql>quit

10. Re-login to MySQL

CentOS under RPM installation mysql5.7.13

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.