CentOS 7 Installation MySQL

Source: Internet
Author: User

1. Configure the Yum source

Download MySQL Source installation package

shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

# install MySQL source

shell> Yum Localinstall mysql57-community-release-el7-8.noarch.rpm

Check that the MySQL source is installed successfully

" mysql.*-community.* "

2. Install MySQL

shell> Yum Install Mysql-community-server

3. Start the MySQL service

Shell> systemctl Start mysqld

Mysqld Viewing the startup status of MySQL

shell> systemctl status mysqld   #状态如下 ↓↓↓↓↓
Mysqld.service-MySQL serverloaded:loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset:disabled) Active:active (running) since five .- .- - Geneva:Panax Notoginseng:Panax NotoginsengCST; 35min agomain PID:2888(mysqld) CGroup:/system.slice/mysqld.service└─2888/usr/sbin/mysqld--daemonize--pid-file=/var/run/mysqld/Mysqld.pid6 Month - Geneva:Panax Notoginseng: $Localhost.localdomain systemd[1]: Starting MySQL Server ... June - Geneva:Panax Notoginseng:Panax NotoginsengLocalhost.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:

' Temporary password ' /var/log/Mysqld.log


Shell> Mysql-uroot-P

Enter password:? aeq,w;i7cnz
MySQL> ALTER USER'Root'@'localhost'Identified by'mynewpass4!'; or MySQL>SetPassword for 'Root'@'localhost'=password ('mynewpass4!');

Note: The password security check plug-in (Validate_password) is installed by default on the mysql5.7 version.

The default password check policy requires that the password must contain: uppercase and lowercase letters, numbers, and special symbols, and cannot be less than 8 bits in length.

Otherwise you will be prompted for error 1819 (HY000): Your password does not satisfy the current policy requirements error as shown:

Default configuration file path:

Configuration file:/etc/my.cnf log file:/var/log//  service startup script:/usr/lib/systemd/system/  Mysqld.service socket file:/var/run/mysqld/mysqld.pid

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.