centos install mysql5.7

# Find linux comes with the database
rpm -qa | grep mariadb

# Delete database comes with MariaDB
RPM -e - nodeps MariaDB-libs-5.5.56-2.el7.x86_64

#依次安装
rpm -ivh mysql-community-common-5.7.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.24-1.el7.x86_64.rpm


ps:
---------------------------------------------------------------------
这里出现的错误
# error: Failed dependencies:
        /usr/bin/perl is needed by mysql-community-server-5.7.24-1.el7.x86_64
        net-tools is needed by mysql-community-server-5.7.24-1.el7.x86_64
        perl(Getopt::Long) is needed by mysql-community-server-5.7.24-1.el7.x86_64
        perl(strict) is needed by mysql-community-server-5.7.24-1.el7.x86_64
解决方法:
$ yum install -y perl-Module-Install.noarch

# error: Failed dependencies:
        net-tools is needed by mysql-community-server-5.7.24-1.el7.x86_64
解决方法:
$ yum install net-tools

# error: Failed dependencies: \
        libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64 \
        libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64 \
        libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64
解决方法:
$ yum install -y numactl

-------------------------------------------------- -------------------
after installation, MySQL MySQL configuration file or the command to check whether there is in the / usr / bin

#mysql configuration file
$ LS /etc/my.cnf
 
# MySQL command
$ cd / usr / bin /
$ LS | grep MySQL
# start mysqld
Service Start mysqld
$ PS EF | grep mysqld

#password
$)(^bell521Z

#mysql configuration
CAT /etc/my.cnf
#mysql log file is password
grep 'password' /var/log/mysqld.log

# ------------------------------------------------- -------------------
# reset the password
# View validata_password plug-in
show global variables like '% validate% ';

# Validate_password_policy- wherein the password strength check on grade:
# 0 / the LOW> only check length.
# 1 / MEDIUM> inspection length, number, case, special characters.
# 2 / STRONG> to check the length, number, case, special characters, the dictionary file.
set global validate_password_policy = 0;

#validate_password_length> minimum password length.
set global validate_password_length = 1;

# Set the password
set password = password ( '123456' );

After the group by using the # mysql5.7 will only_full_group_by, need to finally add the following command in the file /etc/my.cnf
sql_mode = STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

Published 53 original articles · won praise 10 · views 10000 +

Guess you like

Origin blog.csdn.net/blog_zxb/article/details/105047636
Recommended