mysql5.5升级至5.7 或升级至8.0

卸载旧版本mysql

当然要记得备份数据库数据

1.查看需要卸载的部分:

rpm -qa |grep -i mysql

2.开始卸载:

yum remove mysql*

接下来是安装新版mysql

1.下载并安装源:

wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum localinstall mysql57-community-release-el7-7.noarch.rpm
##升级到mysql8
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum -y localinstall mysql80-community-release-el7-3.noarch.rpm 

相关地址:https://dev.mysql.com/downloads/repo/yum/

右键复制链接 wget 请求

2.开始安装:

yum install -y mysql-server
mysql8 使用:
yum install mysql-community-server

3.安装完成并确认版本:

mysql -V

4.接下来就去恢复数据库数据吧.

重启数据库

systemctl restart mysqld

可能会遇到的问题:

Can't connect to local MySQL server through socket '/data/db/mariadb/mysql.sock (找不到mysql.sock)

find / -name mysql.sock 

通过find找不到相关文件时直接重启试试

 

查看初始化密码:

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

 

 

posted @ 2020-10-12 16:26  py卡卡  阅读(1073)  评论(0编辑  收藏  举报