其他
Mysql5.7 rpm离线安装
下载rpm bundle包
https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/mysql-5.7.32-1.sles12.x86_64.rpm-bundle.tar
卸载CentOS7系统自带的mariadb
> rpm -qa|grep mariadb
> rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
安装依赖
> yum install perl* cpan net-tools libaio -y
通过rpm安装mysql
rpm 安装顺序为:
common >> libs >> client >> server
> rpm -ivh mysql-community-common-5.7.30-1.el7.x86_64.rpm
> rpm -ivh mysql-community-libs-5.7.30-1.el7.x86_64.rpm
> rpm -ivh mysql-community-client-5.7.30-1.el7.x86_64.rpm
> rpm -ivh mysql-community-server-5.7.30-1.el7.x86_64.rpm
修改目录权限
rpm 默认是以mysql用户启动的,mysql的安装目录,数据目录都要保证有足够的权限
> chown mysql:mysql -R /var/log/mysql
启动MySQL服务,记录初始密码
> systemctl start mysqld
> cat /var/log/mysqld.log |grep password
xxxxx
登录MySQL修改密码
需要用到上一步的初始密码
> mysql -uroot -pxxxxx
mysql> alter user 'root'@'localhost' identified by '123456';
mysql> flush privileges;