CentOS 7 Installation MySQL

Source: Internet
Author: User
Tags mysql version

Installation Environment: CentOS7 64-bit mini version, install MySQL5.7

1. Configure the Yum source

Download the Yum source RPM installation package on the MySQL website: http://dev.mysql.com/downloads/repo/yum/

# 下载mysql源安装包shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm# 安装mysql源shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

Check that the MySQL source is installed successfully

| grep "mysql.*-community.*"


See shown indicates successful installation.
You can modify vim /etc/yum.repos.d/mysql-community.repo the source to change the MySQL version of the default installation. For example, to install version 5.6, the 5.7 source of the enabled=1 changed to Enabled=0. Then change the 5.6 source enabled=0 to Enabled=1. The effect after the change is as follows:

2. Install MySQL
shell> yum install mysql-community-server
3. Start the MySQL service
shell> systemctl start mysqld

To view the startup status of MySQL

shell> systemctl Status Mysqld mysqld. Service-mysql Server loaded:loaded (/usr/lib/systemd/system/mysqld. Service; Disabled Vendor preset:disabled) active:active (running) since five2016-06-2404:37:Panax Notoginseng CST; 35min ago Main PID: 2888 (mysqld) CGroup:/system. slice/mysqld. service└─ 2888/usr/sbin/mysqld--da Emonize--pid-file=/var/run/mysqld/mysqld. PIDJune  : Notoginseng:$localhost. localdomain systemd[1]: Starting MySQL Server ... June: Panax notoginseng:  localdomain systemd[1]: Started MySQL Server.  
4. Boot start
shell> systemctl enable mysqldshell> systemctl daemon-reload
5. Modify the root local login password

After the MySQL installation is complete, a default password is generated for root in the/var/log/mysqld.log file. Locate the root default password in the following way, and then log in to MySQL to modify it:

shell> grep ‘temporary password‘ /var/log/mysqld.log

shell> mysql -uroot -p                       //登录mysql

CentOS 7 Installation MySQL

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.