1、版本:mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar
安装依赖
yum remove mariadb-libs //删除 mariadb相关内容
yum install perl
yum install numactl
yum install libaio
yum install net-tools
解压mysql安装包
tar -xvf mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar
安装
rpm -ivh commom ---- lib ------- client-------server
按顺序逐一安装完成
image-20201105151855183.png修改数据地址
image-20201105152043608.pngvim /etc/my.cnf
SELINUX设置
vim /etc/selinux/config
把SELINUX的参数修改成disabled即可:
image-20201105152208592.png创建数据存放目录
mkdir /opt/mysqldata
目录授权
chown -R mysql:mysql /opt/mysqldata
启动数据库
systemctl start mysqld.service
查看临时密码
grep 'temporary password' /var/log/mysqld.log
登录修改密码
image-20201105152801751.pngmysql -uroot -p
alter user root@localhost identified by ‘root123’
use mysql
create user 'root'@'%' identified by 'root123';
flush privileges;
grant all on . to 'root'@'%' identified by 'root123';
flush privileges;
网友评论