![使用 RPM 安装 MariaDB 失败](https://linux22.com/image/769864/%E4%BD%BF%E7%94%A8%20RPM%20%E5%AE%89%E8%A3%85%20MariaDB%20%E5%A4%B1%E8%B4%A5.png)
由于无法重新启动服务,我正在尝试重新安装 MariaDB。使用 Centos 7.6。
以前卸载时使用的是 yum,但这次安装我使用的是 RPM,因为我选择了特定的旧版本(10.3.17),而 yum 包中不再提供该版本。
卸载后我没有删除除 /home/mysql 之外的任何配置文件
我的 my.cnf datadir :home/mysql
但是,我的 RPM 安装遇到错误:-
# rpm -ivh MariaDB-*
Preparing... ################################# [100%]
Updating / installing...
1:MariaDB-client-10.3.17-1.el7.cent################################# [ 25%]
2:MariaDB-server-10.3.17-1.el7.cent################################# [ 50%]
Installation of system tables failed! Examine the logs in
/home/mysql for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
shell> /usr/sbin/mysqld --skip-grant-tables --general-log &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables;
Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /home/mysql that may be helpful.
The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss
Please check all of the above before submitting a bug report
at http://mariadb.org/jira
chmod: cannot access ‘/home/mysql/mysql’: No such file or directory
3:MariaDB-server-debuginfo-10.3.17-################################# [ 75%]
4:MariaDB-client-debuginfo-10.3.17-################################# [100%]
错误日志也显示
[ERROR] /usr/sbin/mysqld: unknown variable 'err-log=/var/log/mysqld.log'
感谢任何帮助。非常感谢。
答案1
但是刚才我已经自己解决了这个问题,方法是使用 --deps 删除所有 RPM,将现有的 my.cnf 文件重命名为其他文件并删除 /home/mysql 文件夹。重新安装 RPM 后就没问题了。无论如何,Grace 感谢你的回答,这应该是替代方案。