CentOS 7 系统下mysql 8.0安装方法

CentOS 7 系统下mysql 8.0安装方法

从mysql官网获取下载链接

https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar

通过wget命令下载

wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar

通过tar命令解压

tar -vxf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar

安装之前必须把系统自带的安装包或者以前安装过包清楚掉,否则会安装失败

依次安装以下包(必须按顺序安装):

rpm -ivf mysql-community-common-8.0.28-1.el7.x86_64.rpm

rpm -ivf mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm

rpm -ivf mysql-community-libs-8.0.28-1.el7.x86_64.rpm

rpm -ivf mysql-community-client-8.0.28-1.el7.x86_64.rpm 

rpm -ivf mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm

rpm -ivf mysql-community-server-8.0.28-1.el7.x86_64.rpm

初始化

mysqld --initialize --console

权限设置

chown mysql:mysql -R /var/lib/mysql

启动数据库

systemctl start mysqld

查看初始化后的密码

cat /var/log/mysqld.log|grep localhost

猜你喜欢

转载自blog.csdn.net/qq_53244776/article/details/127192532
今日推荐