CentOS Yum Install mysql5.7 version

Source: Internet
Author: User

I installed a centos version of 7.2

Reference article: http://www.centoscn.com/mysql/2016/0626/7537.html

The installation process is not complicated and the steps are as follows:

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

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

3. shell> Yum Install mysql-community-server//installation MySQL service

4. shell> systemctl start mysqld//start MySQL

5. Set Boot up

Shell> Systemctl Enable mysqld

Shell> Systemctl Daemon-reload

By this step the installation is complete and the MySQL service is started

6. Change the root default 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
# # # #这里会有一个临时密码, enter the following command to log in with a temporary password
Shell> mysql-uroot-p
Then enter that temporary password.

Here say I encountered problems, when the installation is completed, the use of temporary password but unable to log in, reported
MySQL Error 1045 (28000): Access denied for user ' root ' @ ' localhost ' errors.
After a multi-party search, finally found a solution. The specific steps to resolve are as follows:

Shell>service mysqld Stop
Shell> VI my.cnf//my my.cnf file under etc
then add Skip-grant-tables in the configuration file
Shell>service mysqld Start
Shell>mysql
Mysql>use MySQL

# # #接下来重置root密码
mysql> Update Mysql.user set a Uthentication_string=password (' 1q2w3e ') where user= ' root ' and Host = ' localhost ';
mysql> flush Privileges;
Mysql> quit;
shell> VI my.cnf

Comment out skip-grant-tables in config file

Shell>service mysqld Stop
Shell>service mysqld Start

Use Mysql-uroot-p Login Here again, enter a new password to log in

# #创建数据库
CREATE DATABASE Gx_river;
# # #创建用户并授予远程登录权限
GRANT all privileges on * * to ' test ' @ '% ' identified by ' test666 ' with GRANT OPTION;

CentOS Yum Install mysql5.7 version

Related Article

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.