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