• 查看是否已安装mysql

rpm -qa |grep mysql

  • 开启防火墙

firewall-cmd –add-port=3306/tcp –permanent

  • 重启防火墙

systemctl restart firewalld

  • 卸载软件

rpm -e mysql …..(软件名称)

yum remove mysql-community mysql-community-server mysql-community-libs mysql-community-common

  • 查看是否卸载干净,如果查询到结果,继续卸载

rpm -qa |grep -i mysql

yum remove mysql-community-client-plugins

  • 清理文件
  • 查看mysql文件目录:

find / -name mysql

  • 删除掉该文件:

rm -rf /home/mysql
rm -rf /etc/selinux/targeted/active/modules/100/mysql
rm -rf /var/spool/mail/mysql
rm -rf /usr/lib64/mysql
rm -rf /usr/share/mysql
rm -rf /usr/local/mysql
rm -rf /opt/mysql

  • 在一台可以联网的机器上执行下列命令准备离线安装包,机器最好内核版本一致

mkdir -p /usr/local/src/wget

yum install –downloadonly –downloaddir=/usr/local/src/wget wget

cd /usr/local/src/wget

  • 拷贝下载好的离线安装包到无网络的机器后执行下列命令

rpm -Uvh *.rpm –nodeps –force

  • 确认是否安装成功

yum list installed | grep “wget”

文档更新时间: 2021-09-07 08:00   作者:admin