Kiểm tra lỗi:
systemctl start mariadb.service
Kết quả xuất hiện:
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.
Nguyên nhân và cách xử lý:
Xoá hoặc đổi tên của file “tc.log” tại thư mục “/var/lib/mysql”
Cuối cùng: service mysql restart
Xem thêm: https://stackoverflow.com/questions/65189190/cant-start-mariadb-on-debian-10
Cảm ơn bác, đổi tên tc.log xong restart lại dịch vụ thì chạy ngon