在Ubuntu 20.04桌面上升级MySQL 5.6到MariaDB 10.5:默认值处理中出现致命错误

dxpyg8gm  于 7个月前  发布在  Mysql
关注(0)|答案(1)|浏览(85)

我正在尝试在我的Ubuntu 20.04桌面上将MySQL 5.6升级到MariaDB 10.5。
我已经删除了directions的MySQL(取消/usr/local/mysql的链接)。
我已经安装了installation page的MariaDB。
它成功了,报告了以下故障:

Setting up mariadb-common (1:10.5.22+maria~ubu2004) ...
update-alternatives: warning: alternative /etc/mysql/my.cnf.fallback (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode

...

Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

尝试运行它会导致以下错误消息:

$ mysql
mysql: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted
$ mariadb
mariadb: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted
$ mysqld
mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted

systemctl status mariadb.service返回以下输出:

● mariadb.service - MariaDB 10.5.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: failed (Result: exit-code) since Thu 2023-09-07 17:44:36 IDT; 26min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 185391 (code=exited, status=1/FAILURE)

Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: Starting MariaDB 10.5.22 database server...
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 sh[185388]: [108B blob data]
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 sh[185388]: Fatal error in defaults handling. Program aborted
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 mariadbd[185391]: [100B blob data]
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 mariadbd[185391]: Fatal error in defaults handling. Program aborted
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: Failed to start MariaDB 10.5.22 database server.

以下是journalctl -xr输出的相关行:

Sep 07 17:44:40 b-IdeaPad-L3-15IML05 dbus-daemon[1096]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.1907' (uid=0 pid=186517 comm="/usr/bin/gdbus call --system --dest org.freedeskto" label="unconfi>
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.service target mysql.server.service has different name
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.server.service is not a symlink, ignoring.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: Reloading.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: Failed to start MariaDB 10.5.22 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- A start job for unit mariadb.service has finished with a failure.
--  
-- The job identifier is 42629 and the job result is failed.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- An ExecStart= process belonging to unit mariadb.service has exited.
--  
-- The process' exit code is 'exited' and its exit status is 1.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 mariadbd[185391]: Fatal error in defaults handling. Program aborted
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 mariadbd[185391]: [100B blob data]
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 sh[185388]: Fatal error in defaults handling. Program aborted
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 sh[185388]: [108B blob data]
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: Starting MariaDB 10.5.22 database server...
-- Subject: A start job for unit mariadb.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- A start job for unit mariadb.service has begun execution.
--  
-- The job identifier is 42629.
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.service target mysql.server.service has different name
Sep 07 17:44:36 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.server.service is not a symlink, ignoring.
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: Reloading.
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.service target mysql.server.service has different name
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.server.service is not a symlink, ignoring.
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: Reloading.
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.service target mysql.server.service has different name
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.server.service is not a symlink, ignoring.
Sep 07 17:44:35 b-IdeaPad-L3-15IML05 systemd[1]: Reloading.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 kernel: audit: type=1400 audit(1694097874.898:240): apparmor="STATUS" operation="profile_remove" info="profile does not exist" error=-2 profile="unconfined" name="/usr/sbin/mariadbd" pid=185287 comm="apparmor_parser"
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 audit[185287]: AVC apparmor="STATUS" operation="profile_remove" info="profile does not exist" error=-2 profile="unconfined" name="/usr/sbin/mariadbd" pid=185287 comm="apparmor_parser"
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: at https://mariadb.org/jira
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: Please check all of the above before submitting a bug report
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: the maria-discuss email list at https://launchpad.net/~maria-discuss
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: You can find the latest source at https://downloads.mariadb.org and
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: The latest information about mysql_install_db is available at
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: --general-log gives you a log in /var/lib/mysql that may be helpful.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: Try '/usr/sbin/mysqld --help' if you have problems with paths.  Using
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:     MariaDB> show tables;
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:     shell> /usr/bin/mariadb -u root mysql
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: to connect to the mysql database and look at the grant tables:
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: and use the command line tool /usr/bin/mariadb
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:     shell> /usr/sbin/mysqld --skip-grant-tables --general-log &
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: You can also try to start the mariadbd daemon with:
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: my.cnf files. You can ignore these by doing:
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: The problem could be conflicting information in an external
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: /var/lib/mysql for more information.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: Installation of system tables failed!  Examine the logs in
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]:  
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: Fatal error in defaults handling. Program aborted
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: [98B blob data]
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: Fatal error in defaults handling. Program aborted
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 mariadb-server-10.5.postinst[185259]: [108B blob data]
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 systemd[1]: Finished Message of the Day.
-- Subject: A start job for unit motd-news.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- A start job for unit motd-news.service has finished successfully.
--  
-- The job identifier is 42317.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 systemd[1]: motd-news.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- The unit motd-news.service has successfully entered the 'dead' state.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 systemd[1]: Starting Message of the Day...
-- Subject: A start job for unit motd-news.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--  
-- A start job for unit motd-news.service has begun execution.
--  
-- The job identifier is 42317.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.service target mysql.server.service has different name
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/mysql.server.service is not a symlink, ignoring.
Sep 07 17:44:34 b-IdeaPad-L3-15IML05 systemd[1]: Reloading.
Sep 07 17:40:50 b-IdeaPad-L3-15IML05 dbus-daemon[1096]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'

以下是我尝试过的几件事:

$mariadb-upgrade
mariadb-upgrade: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted
$ mysqld --print-defaults
mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted
$ my_print_defaults --mysqld
my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted

我将感激任何帮助。

cmssoen2

cmssoen21#

“Fatal error in defaults handling”表示在您的配置文件中包含了一个不存在的差异配置文件,或者存在权限问题,导致MariaDB服务器无法读取该文件。
要跟踪哪个文件,请运行:

sudo -u mysql mysqld --no-defaults --verbose --help | grep -A 1 'Default options'

将有一个文件列表,如:

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

/etc/mysql/my.cnf中,我希望有:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

你的问题说/etc/mysql/conf.d不存在。
为了简单起见,我从/etc/mysql/my.cnf中删除!includedir /etc/mysql/conf.d/,然后服务器应该启动。

相关问题