无法在 Debian 10 上启动 MariaDB

无法在 Debian 10 上启动 MariaDB

我似乎无法再启动 mariadb sql。互联网上说了很多东西,但它们似乎都是“有风险的”,而且似乎真的要视情况而定。所以这是我的。我不知道发生了什么/什么时候发生的事情,但我害怕丢失我的订阅者数据。你们,超级英雄,有什么建议?当我尝试启动 mariadb 时:

me@server:# systemctl start 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.

并使用 systemctl status mariadb.service:

me@server:# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.27 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-12-07 21:04:05 CET; 1min 53s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 13289 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
  Process: 13290 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 13292 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environm
  Process: 13339 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
 Main PID: 13339 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Dec 07 21:03:59 server systemd[1]: Starting MariaDB 10.3.27 database server...
Dec 07 21:04:01 server mysqld[13339]: 2020-12-07 21:04:01 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 13339 ...
Dec 07 21:04:05 server systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 07 21:04:05 server systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 07 21:04:05 server systemd[1]: Failed to start MariaDB 10.3.27 database server.

当我进入 journalctl -xe 时,我只得到:

Dec 07 21:10:04 vps69770 sshd[13784]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=161.35.121.130  user=root
Dec 07 21:10:04  sshd[13712]: Received disconnect from 124.239.216.233 port 59950:11: Bye Bye [preauth]
Dec 07 21:10:04  sshd[13712]: Disconnected from authenticating user root 124.239.216.233 port 59950 [preauth]
Dec 07 21:10:04  sshd[13771]: Failed password for root from 111.201.133.174 port 48444 ssh2
Dec 07 21:10:05  sshd[13771]: Received disconnect from 111.201.133.174 port 48444:11: Bye Bye [preauth]
Dec 07 21:10:05  sshd[13771]: Disconnected from authenticating user root 111.201.133.174 port 48444 [preauth]
Dec 07 21:10:05  systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit mariadb.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Dec 07 21:10:05 server systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Dec 07 21:10:05 server systemd[1]: Failed to start MariaDB 10.3.27 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit mariadb.service has finished with a failure.
-- 
-- The job identifier is 1241 and the job result is failed.
Dec 07 21:10:06 server sshd[13784]: Failed password for root from 161.35.121.130 port 37142 ssh2
Dec 07 21:10:06 server sshd[13784]: Received disconnect from 161.35.121.130 port 37142:11: Bye Bye [preauth]
Dec 07 21:10:06 server sshd[13784]: Disconnected from authenticating user root 161.35.121.130 port 37142 [preauth]

这没什么帮助

按照建议,以下是 mariadb 错误的输出

2020-12-07 22:23:02 0 [Note] InnoDB: Using Linux native AIO
2020-12-07 22:23:02 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-12-07 22:23:02 0 [Note] InnoDB: Uses event mutexes
2020-12-07 22:23:02 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-12-07 22:23:02 0 [Note] InnoDB: Number of pools: 1
2020-12-07 22:23:02 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-12-07 22:23:02 0 [Warning] InnoDB: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
2020-12-07 22:23:02 0 [Warning] InnoDB: io_setup() attempt 1.
2020-12-07 22:23:02 0 [Warning] InnoDB: io_setup() attempt 2.
2020-12-07 22:23:03 0 [Warning] InnoDB: io_setup() attempt 3.
2020-12-07 22:23:03 0 [Warning] InnoDB: io_setup() attempt 4.
2020-12-07 22:23:04 0 [Warning] InnoDB: io_setup() attempt 5.
2020-12-07 22:23:04 0 [Warning] InnoDB: io_setup() failed with EAGAIN after 5 attempts.
2020-12-07 22:23:04 0 [Note] InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
2020-12-07 22:23:04 0 [Warning] InnoDB: Warning: Linux Native AIO disabled because _linux_create_io_ctx() failed. To get rid of this warning you can try increasing system fs.aio-max-nr to 1048576 or larger or setting innodb_use_native_aio = 0 in my.cnf
2020-12-07 22:23:04 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-12-07 22:23:04 0 [Note] InnoDB: Completed initialization of buffer pool
2020-12-07 22:23:04 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-12-07 22:23:06 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-12-07 22:23:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-12-07 22:23:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-12-07 22:23:06 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-12-07 22:23:06 0 [Note] InnoDB: Waiting for purge to start
2020-12-07 22:23:06 0 [Note] InnoDB: 10.3.27 started; log sequence number 27901641; transaction id 116488
2020-12-07 22:23:06 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-12-07 22:23:06 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-12-07 22:23:06 0 [Note] Recovering after a crash using tc.log
2020-12-07 22:23:06 0 [ERROR] Bad magic header in tc log
2020-12-07 22:23:06 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2020-12-07 22:23:06 0 [ERROR] Can't init tc log
2020-12-07 22:23:06 0 [ERROR] Aborting

我不知道该怎么办。我真的不想丢失我的数据库。感谢您的意见

答案1

通过删除/重命名 tc.log 解决了该问题:

mv -vi /var/lib/mysql/tc.log /root

并重新启动数据库

service mysql restart

tc 日志中的 magic 标头不正确在 MariaDB 知识库中。

相关内容