这篇文章上次修改于 264 天前,可能其部分内容已经发生变化,如有疑问可询问作者。
之前介绍过在线安装mysql8,以下离线安装mysql8方法。
1.下载离线安装包
centos7>>wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
centos8>>wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
2.下载后解包
tar -xvf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
解压后的文件:
mysql-community-client-8.0.28-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
mysql-community-common-8.0.28-1.el7.x86_64.rpm
mysql-community-devel-8.0.28-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.28-1.el7.x86_64.rpm
mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
mysql-community-libs-8.0.28-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
mysql-community-server-8.0.28-1.el7.x86_64.rpm
mysql-community-test-8.0.28-1.el7.x86_64.rpm
3.安装以下包:
rpm -ivh mysql-community-common-8.0.16-2.el7.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.28-1.el7.x86_64.rpm
如果安装过程中出现依赖包问题,依提示安装对应的包即可。
4.依次执行
service mysqld stop
mysqld --initialize --console
chown -R mysql:mysql /var/lib/mysql/
systemctl start mysqld
获取第一次临时密码cat /var/log/mysqld.log
使用临时密码mysql -u root -p连接mysql
然后就是数据库具体的各种配置操作,这里就不再重复。
没有评论
博主关闭了评论...