CentOS 7 Yum Install MySQL

Source: Internet
Author: User
Tags yum repolist

A: Go to the official website to view the latest installation package
https://dev.mysql.com/downloads/repo/yum/
Two: Download MySQL source installation package
mysql80-community-release-el7-1.noarch.rpm
Install MySQL source
Yum-y Install mysql80-community-release-el7-1.noarch.rpm
Yum Repolist All | grep MySQL
Three: Install MySQL server
Yum Install Mysql-community-server
The middle will pop up is the choice of whether or not, select Y can, and then patiently wait for it ....
Four: Start the MySQL service
Systemctl Start Mysqld.service
Run the command to see the running state
Systemctl Status Mysqld.service
Five: Initialize the database password
Check the initial password
grep "Password"/var/log/mysqld.log
Login
Mysql-uroot-p
Change Password
ALTER USER ' root ' @ ' localhost ' identified by ' **************** ';
MySQL Default password security check-in (Validate_password) is installed, and the default password checking 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 it will prompt error 1819 (HY000): Your password does not satisfy the current policy requirements error
VI: Database Authorization
Database is not authorized, only localhost local access is supported
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
You need to enter a user name and password when connecting to the database remotely
User name: Root
Password: 123456
Mysql>flush privileges;
You can also implement a remote by modifying the table:
Mysql-u root-p
mysql> use MySQL;
mysql> Update user Set host = '% ' where user = ' root ';

Seven: Set auto-start
Systemctl Enable Mysqld
Systemctl Daemon-reload

CentOS 7 Yum Install 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.