- 首页 > it技术 > >
Mysql8.0离线安装(centos7)
- rpm -qa|grep mariadb 查看是否安装mariadb
- 如果存在,用rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64 卸载(软件名从上面查询结果复制)。
- tar -xvf mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar 解压MySQL安装包
- rpm -ivh mysql-community-common-8.0.16-2.el7.x86_64.rpm 依次安装软件包,检测到依赖缺失,用yum install安装依赖。
- rpm -ivh mysql-community-libs-8.0.16-2.el7.x86_64.rpm
- rpm -ivh mysql-community-libs-compat-8.0.16-2.el7.x86_64.rpm
- rpm -ivh mysql-community-embedded-compat-8.0.16-2.el7.x86_64.rpm
- rpm -ivh mysql-community-client-8.0.16-2.el7.x86_64.rpm
- rpm -ivh mysql-community-devel-8.0.16-2.el7.x86_64.rpm (需要安装依赖:yum install openssl-devel)
- rpm -ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm (需要安装依赖:yum install net-tools、yum install perl)
- systemctl start mysqld.service 启动mysql服务 systemctl enable mysqld.service (设置开机启动)
- grep 'temporary password' /var/log/mysqld.log 查看初始密码
- mysql –uroot –p登录mysql
- ALTER USER 'root'@'localhost' IDENTIFIED BY 'pwd';
修改密码
- update user set host='%' where user ='root';
授权远程登录,flush privileges;
刷新权限。
- ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
(去除身份验证,防止maxwell无法连接,可能需要执行两遍)。
推荐阅读