mysql 装置在指定目录
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
按程序逐个装置实现
批改数据地址
\# vim /etc/my.cnf
SELINUX 设置
\# vim /etc/selinux/config
把 SELINUX 的参数批改成 disabled 即可:
创立数据寄存目录
\# mkdir /opt/mysqldata
目录受权
\# chown -R mysql:mysq /opt/mysqldata
启动数据库
\# systemctl start mysqld.service
查看长期明码
\# grep ‘temporary password’ /var/log/mysqld.log
登录批改明码
\# mysql -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;