1、下载地址
https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
2、解压
tar -xvf mysql-8.0.29-1.el7.x86_64.rpm-bundle.tar
3、删除mariadb
rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 --nodeps
4、安装perl
yum -y install perl
5、安装(没有权限,rpm前加sudo)
rpm -hiv mysql-community-common-8.0.29-1.el7.x86_64.rpm
rpm -hiv mysql-community-client-plugins-8.0.29-1.el7.x86_64.rpm
rpm -hiv mysql-community-libs-8.0.29-1.el7.x86_64.rpm
rpm -hiv mysql-community-client-8.0.29-1.el7.x86_64.rpm
rpm -hiv mysql-community-icu-data-files-8.0.29-1.el7.x86_64.rpm
rpm -hiv mysql-community-server-8.0.29-1.el7.x86_64.rpm
6、启动MySQL服务
systemctl start mysqld
7、查看MySQL的进程
systemctl status mysqld
8、查看初始化密码
cat /var/log/mysqld.log | grep password
9、登录MySQL8
mysql -uroot -p密码
10、MySQL8的修改密码和MySQL5不一样。
ALTER USER 'root'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY 'MySQL123!';
11、设置远程登录
use mysql;
update user set host = '%' where user ='root';
flush privileges;
linux 安装mysql
最新推荐文章于 2024-11-08 14:34:47 发布