在 cPanel 上卸载 MySQL 以替换 MariaDB

在 cPanel 上卸载 MySQL 以替换 MariaDB

好吧,我花了一天的前半部分时间研究如何删除 MySQL 以安装 MariaDB,而后半部分时间尝试重新安装 MySQL,因为有些东西搞砸了。所以现在我来向大家寻求帮助。

我有一个装有 cPanel/WHM 的盒子。CentOS 5.6 64 位。我已将 MySQL 升级(通过 WHM)到 5.5.24,并且成功了。经过一番研究,我发现的选项是一个带有管道 greps 和破折号的令人生畏的 Linux 命令,以及另一个命令

yum remove mysql

我试了一下,它似乎删除了mysql......我尝试从此说明页面它开始运行然后出现了无数的错误(这里有一个小样本):

Transaction Check Error:
  file /etc/init.d/mysql from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysql_convert_table_format from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysql_install_db from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysql_secure_installation from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqlbug from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqld_multi from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqld_safe from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqldumpslow from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/bin/mysqlhotcopy from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/innochecksum.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/my_print_defaults.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/myisam_ftdump.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/myisamchk.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64
  file /usr/share/man/man1/myisamlog.1.gz from install of MariaDB-server-5.5.25-1.i386 conflicts with file from package MySQL-server-5.5.24-1.cp.1132.x86_64

因此,看起来 MySQL 未正确删除。我从不同网站上提供的不同教程中了解到,要安装 MariaDB,您必须卸载/删除 MySQL,并且没有提供任何有关如何执行此操作的命令。

有谁知道如何“安全地”删除 WHM/cPanel 服务器上的 MySQL,以便我可以安装 MariaDB?

这是我的 repo 文件,以防有人需要知道......

# MariaDB repository list - created 2012-07-10 17:09 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos5-x86
gpgcheck=1

答案1

您应该先删除 MySQL 服务器(到目前为止您只删除了客户端),这样yum remove MySQL-server-5.5.24-1.cp.1132.x86_64就可以了。之后 MariaDB 应该会顺利安装。我认为最好先备份所有内容。您/var/lib/mysql至少应该备份。

答案2

除了软件包冲突之外:

您正在 64 位主机上安装 32 位 DB 引擎。这就是 repo 行中“x86”的含义:

baseurl = http://yum.mariadb.org/5.5/centos5-x86

建议你用

baseurl = http://yum.mariadb.org/5.5/centos5-amd64

相关内容