本文共 2193 字,大约阅读时间需要 7 分钟。
# 查找linux自带的数据库
rpm -qa | grep mariadb#删除自带的数据库 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---------------------------------------------------------------------
安装好后,可以去检查是否存在MySQL的配置文件或者MySQL的命令在/usr/bin下#mysql配置文件
$ ls /etc/my.cnf # mysql命令 $ cd /usr/bin/ $ ls | grep mysql # 启动mysqld service mysqld start $ ps ef | grep mysqld#password
$)(^bell521Z#mysql 配置
cat /etc/my.cnf #mysql 日志文件中有密码 grep 'password' /var/log/mysqld.log#--------------------------------------------------------------------
#重新设置密码 #查看validata_password插件 show global variables like '%validate%';#其中关于validate_password_policy-密码强度检查等级:
#0/LOW > 只检查长度。 #1/MEDIUM > 检查长度、数字、大小写、特殊字符。 #2/STRONG > 检查长度、数字、大小写、特殊字符字典文件。 set global validate_password_policy = 0;#validate_password_length > 密码最小长度。
set global validate_password_length = 1;#设置密码
set password = password('123456');# mysql5.7之后使用 group by 会出现 only_full_group_by , 需要在/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转载地址:http://eiyvb.baihongyu.com/