CentOS7完全卸载MariaDB

在CentOS7系统中,由于未完全卸载MariaDB及其依赖导致重新安装后启动失败。通过执行`yum remove mariadb`和`yum remove mariadb-libs`清除残留,删除相关配置文件和目录,然后重新安装并配置,解决了启动报错问题。确保了MariaDB的远程登录功能正常。
摘要由CSDN通过智能技术生成

CentOS7完全卸载MariaDB

问题

在CentOS7中安装了MariaDB和MariaDB-server,卸载了以后重新安装,然后使用Systemctl start mariadb,出现了“Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.”的错误提示,仔细研究了一下,发现在使用 yum remove mariadb 卸载并没有将所有依赖项全部卸载导致的问题。

卸载

  1. yum remove mariadb
    卸载mariadb,同时也卸载了mariadb-server
  2. yum list installed | grep mariadb
    发现在安装mariadb时作为依赖项的mariadb-libs没有被删除。
  3. yum remove mariadb-libs
    将其卸载
  4. rm -rf /etc/my.cnf
  5. rm -rf $(find / -name mysql)
    删除所有包含mysql的文件(夹)
  6. reboot

安装

  1. yum install mariadb
  2. yum install mariadb-server
    按mariadb并不同时安装mariadb-server
  3. systemctl start mariadb
  4. systemctl enable mariadb
  5. mysql_secure_installation
    配置mariadb。
  6. mysql -uroot -p
    使用前面设置的root密码登录进mariadb
  7. update mysql.user set host=’%’ where user=‘root’ and host=‘localhost’;
    flush privileges;
    设置mysql可用远程登录。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值