RPM安装MySQL 8.0
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RPM安装MySQL 8.0相关的知识,希望对你有一定的参考价值。
卸载centos自带的mariadb
rpm -qa mariadb*
rpm -e *** --nodeps
下载mysql 8.0的rpm完整包
wget -O /tmp/mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar
解压出rpm包
cd /tmp/
tar xvf mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar
yum安装一下net-tools库、perl
yum -y install net-tools*
yum -y install perl
新建用户和用户组
groupadd mysql
useradd -g mysql mysql
依次编译安装
rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm
初始化mysql
mysqld --initialize --user=mysql
启动mysql
systemctl start mysqld
查看生成的密码
vim /var/log/mysqld.log
#k7jIhWyXDbj
登陆mysql
mysql -u root -p
修改密码:
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123456‘;
flush privileges;
至此MySQL 8.0 安装完成
以上是关于RPM安装MySQL 8.0的主要内容,如果未能解决你的问题,请参考以下文章
MySQL入门:Linux 6 RPM方式安装MySQL 8.0