RedHat6.5 detailed tutorial on installing MySQL5.7, redhat6.5mysql5.7
RedHat6.5 install MySQL5.7 for your reference. The details are as follows:
Installation environment: RedHat6.5
Step 1:Download
Download MySQL5.7: http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar
Step 2:Install
Check whether MySQL is installed on the server before installation. If yes, uninstall it:
[Root @ worker1 tmp] # rpm-qa | grep mysqlmysql-libs-5.1.71-1.el6.x86_64 [root @ worker1 tmp] # rpm-e -- nodeps mysql-libs-5.1.71-1.el6.x86_64 // uninstall
Decompress the downloaded file:
[root@worker1 tmp]# tar -xf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar
Install in sequence:
rpm -ivh mysql-community-common-5.7.12-1.el6.x86_64.rpmrpm -ivh mysql-community-libs-5.7.12-1.el6.x86_64.rpmrpm -ivh mysql-community-devel-5.7.12-1.el6.x86_64.rpmrpm -ivh mysql-community-client-5.7.12-1.el6.x86_64.rpmrpm -ivh mysql-community-server-5.7.12-1.el6.x86_64.rpm
Not surprisingly, MySQL should have been installed successfully.
Step 3:Environment variable settings
1. start MySQL: service mysqld start
2. log on to mysql-u root-p. If the initial logon password is blank, press Enter:
The reason for this error is that the mysql. user table in MySQL5.7 does not have the Password field. Therefore, you must log on securely and change the Password.
SolutionAs follows:
Modify the MySQL configuration file vim/etc/my. cnf, add skip-grant-tables at the end of the file, save the file, restart MySQL service: service mysqld restart, and then log on again.
3. Change the password under the database named mysql:
Execute the following commands in sequence:
mysql> use mysqlmysql> update user set password_expired='N' where user='root'; mysql> update user set authentication_string=password('123456') where user=‘root';mysql> flush privileges;
1. Note:Be sure to remove the Skip password detection content added before the my. cnf configuration file and restart the service;
Others:
1. Encoding settings: vim/etc/my. cnf. Add the encoding content at the end of the file default-character-set = utf8
2. Allow Remote Access to MySQL:
Grant data access permissions to any host
Mysql> grant all privileges on.To 'root' @ '%' with grant option;
ERROR 1133 (42000): Can't find any matching row in the user table
In fact, if the root user exists in the mysql. user table beforehand, or, adding identified by 'Password' to the end of the sentence will be normal. The following command line
Mysql> grant all privileges on.To 'root' @ '%' identified by '000000' with grant option;
3. Change Password Policy:
Mysql> set global validate_password_length = 0; -- change the password length mysql> set global validate_password_policy = 0; -- change the password policy to LOW
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.