Install MySQL on CentOS 6.9 rpm
Environment:
Linux:centos Release 6.9 64bit
mysql:mysq-5.7.18
1. Create a MySQL directory at/home and download the following four packages
http://mirrors.sohu.com/mysql/MySQL-5.7/
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-client-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-common-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-libs-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-server-5.7.18-1.el6.x86_64.rpm
2. Check if MySQL RPM-related packages are installed and removed
[Email protected] mysql]# Rpm-qa | Grep-i MySQL
Mysql-libs-5.1.73-8.el6_8.x86_64
[Email protected] mysql]# rpm-e mysql-libs-5.1.73-8.el6_8.x86_64
error:failed dependencies:
libmysqlclient.so.16 () (64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
libmysqlclient.so.16 (libmysqlclient_16) (64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
Mysql-libs is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
[Email protected] mysql]#
Remove the dependent packages
[email protected] mysql]# Yum remove-y mysql-libs
Re-query whether to delete clean
[Email protected] mysql]# Rpm-qa | Grep-i MySQL
[Email protected] mysql]#
3. Install the four RPM packages at the same time
RPM-IVH mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm mysql-community-server-5.7.18-1.el6.x86_64.rpm
4, there is a lack of dependency package solution
[Email protected] home]# RPM-IVH mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm mysql-community-server-5.7.18-1.el6.x86_64.rpm
Warning:mysql-community-client-5.7.18-1.el6.x86_64.rpm:header V3 dsa/sha1 Signature, key ID 5072e1f5:nokey
error:failed dependencies:
Libnuma.so.1 () (64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
Libnuma.so.1 (libnuma_1.1) (64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
Libnuma.so.1 (libnuma_1.2) (64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
[email protected] home]# Yum install-y numactl
5. Password acquisition
Get the temporary password for MySQL for the first time by #grep "password"/var/log/mysqld.log command
Log on to the server with this password, you must change the password immediately, or the operation query times error
The password you initially set must match the length and must contain numbers, lowercase or uppercase letters, and special characters.
If you want to set a simple password, do the following:
First, modify the value of the Validate_password_policy parameter
mysql> set global validate_password_policy=0; #定义复杂度
mysql> set global validate_password_length=1; #定义长度 Default is 8
Mysql>set password for ' root ' @ ' localhost ' =password (' 123456 '); #设置root密码为123456
mysql> flush Privileges; #刷新权限使配置生效
This article is from the "Tomorrow Inspiration" blog, make sure to keep this source http://coolner.blog.51cto.com/957576/1930534
Install MySQL on CentOS 6.9 rpm