我最近從 debian 儲存庫更新了伺服器上的 mariadb,現在 sql 伺服器無法啟動。我認為更新可能會與舊軟體包發生衝突,但我不確定如何繼續。下面是sql server的系統狀態回授:
● mariadb.service - MariaDB 10.3.15 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: timeout) since Wed 2019-05-22 15:08:27 UTC; 1min 12s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 1328 (code=exited, status=0/SUCCESS)
May 22 15:08:25 enoki mysqld[1328]: 2019-05-22 15:08:25 0 [Note] Event Scheduler: Purging the queue. 0 events
May 22 15:08:25 enoki mysqld[1328]: 2019-05-22 15:08:25 0 [Note] InnoDB: FTS optimize thread exiting.
May 22 15:08:25 enoki mysqld[1328]: 2019-05-22 15:08:25 0 [Note] InnoDB: Starting shutdown...
May 22 15:08:25 enoki mysqld[1328]: 2019-05-22 15:08:25 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
May 22 15:08:25 enoki mysqld[1328]: 2019-05-22 15:08:25 0 [Note] InnoDB: Buffer pool(s) dump completed at 190522 15:08:25
May 22 15:08:27 enoki mysqld[1328]: 2019-05-22 15:08:27 0 [Note] InnoDB: Shutdown completed; log sequence number 1989836; transaction id 536
May 22 15:08:27 enoki mysqld[1328]: 2019-05-22 15:08:27 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
May 22 15:08:27 enoki mysqld[1328]: 2019-05-22 15:08:27 0 [Note] /usr/sbin/mysqld: Shutdown complete
May 22 15:08:27 enoki systemd[1]: mariadb.service: Failed with result 'timeout'.
May 22 15:08:27 enoki systemd[1]: Failed to start MariaDB 10.3.15 database server.
我嘗試將其視為損壞的安裝來修復它,並收到以下訊息:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mariadb-client-10.1 : Conflicts: mysql-client-core-5.5
Conflicts: mysql-client-core-5.6
Conflicts: mysql-client-core-5.7
Conflicts: virtual-mysql-client
Breaks: mysql-client-5.5
Breaks: mysql-client-5.6
Breaks: mysql-client-5.7
mariadb-client-10.3 : Conflicts: mariadb-client-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
Conflicts: virtual-mysql-client
mariadb-client-core-10.1 : Conflicts: mysql-client-5.5
Conflicts: mysql-client-5.6
Conflicts: mysql-client-5.7
Conflicts: virtual-mysql-client-core
Breaks: mysql-client-core-5.5
Breaks: mysql-client-core-5.6
Breaks: mysql-client-core-5.7
mariadb-client-core-10.3 : Conflicts: mariadb-client-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
Conflicts: mariadb-client-core-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
Conflicts: virtual-mysql-client-core
mariadb-plugin-mroonga : Breaks: mariadb-server-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
mariadb-plugin-spider : Breaks: mariadb-server-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
mariadb-plugin-tokudb : Breaks: mariadb-server-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
mariadb-server-10.1 : Conflicts: mysql-server-core-5.5
Conflicts: mysql-server-core-5.6
Conflicts: mysql-server-core-5.7
Conflicts: virtual-mysql-server
Breaks: mysql-client-5.5
mariadb-server-10.3 : Conflicts: mariadb-server-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
Conflicts: virtual-mysql-server
mariadb-server-core-10.1 : Conflicts: virtual-mysql-server-core
Breaks: mysql-client-5.5
Breaks: mysql-client-5.6
Breaks: mysql-server-core-5.5
Breaks: mysql-server-core-5.6
Breaks: mysql-server-core-5.7
mariadb-server-core-10.3 : Conflicts: mariadb-server-core-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
Conflicts: virtual-mysql-server-core
Breaks: mariadb-client-10.1 but 1:10.1.38-0ubuntu0.18.04.2 is to be installed
E: Broken packages
當我嘗試連線時mysql錯誤是:
mysqli_real_connect(): (HY000/2002): No such file or directory
當我嘗試執行 MySQL 時出現錯誤日誌:
2019-05-22 22:32:35 0 [Note] InnoDB: Using Linux native AIO
2019-05-22 22:32:35 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-22 22:32:35 0 [Note] InnoDB: Uses event mutexes
2019-05-22 22:32:35 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-05-22 22:32:35 0 [Note] InnoDB: Number of pools: 1
2019-05-22 22:32:35 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-05-22 22:32:35 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-05-22 22:32:35 0 [Note] InnoDB: Completed initialization of buffer pool
2019-05-22 22:32:35 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-05-22 22:32:35 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-05-22 22:32:35 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-05-22 22:32:35 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-05-22 22:32:35 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-05-22 22:32:35 0 [Note] InnoDB: 10.3.15 started; log sequence number 1989836; transaction id 535
2019-05-22 22:32:35 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2019-05-22 22:32:35 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-05-22 22:32:35 0 [Note] InnoDB: Buffer pool(s) load completed at 190522 22:32:35
2019-05-22 22:32:35 0 [Note] Server socket created on IP: '::'.
2019-05-22 22:32:35 0 [Note] Reading of all Master_info entries succeded
2019-05-22 22:32:35 0 [Note] Added new Master_info '' to hash table
2019-05-22 22:32:35 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.15-MariaDB-1:10.3.15+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
2019-05-22 22:34:05 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2019-05-22 22:34:05 0 [Note] Event Scheduler: Purging the queue. 0 events
2019-05-22 22:34:05 0 [Note] InnoDB: FTS optimize thread exiting.
2019-05-22 22:34:05 0 [Note] InnoDB: Starting shutdown...
2019-05-22 22:34:05 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2019-05-22 22:34:05 0 [Note] InnoDB: Buffer pool(s) dump completed at 190522 22:34:05
2019-05-22 22:34:06 0 [Note] InnoDB: Shutdown completed; log sequence number 1989845; transaction id 536
2019-05-22 22:34:06 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-05-22 22:34:06 0 [Note] /usr/sbin/mysqld: Shutdown complete
“journalctl -xe”的輸出:
May 22 23:09:26 enoki kernel: [UFW BLOCK] IN=eno1 OUT= MAC=01:00:5e:00:00:01:28:c6:8e:26:6e:ee:08:00 SRC=192.168.1.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=58892 PROTO=2
May 22 23:09:33 enoki systemd[1]: mariadb.service: Start operation timed out. Terminating.
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.276:58): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.296:59): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.400:60): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.496:61): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.600:62): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.700:63): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:33 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:33 enoki kernel: audit: type=1400 audit(1558566573.728:64): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:34 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:34 enoki audit[12157]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=111 ouid=0
May 22 23:09:34 enoki kernel: audit: type=1400 audit(1558566574.308:65): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:34 enoki kernel: audit: type=1400 audit(1558566574.308:66): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=12157 comm="mysqld" requested_mask="w" denied_mask
May 22 23:09:34 enoki systemd[1]: mariadb.service: Failed with result 'timeout'.
May 22 23:09:34 enoki systemd[1]: Failed to start MariaDB 10.3.15 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has failed.
--
-- The result is RESULT.
任何幫助深表感謝!