Xtrabackup restore and then start Mysql fails!,which one can help this thank you!

First,do full bakup,use this,xtrabackup --user=root --password=“xxx” --backup --target-dir=/root/fullbak_20221019,this is ok
Second,do full restore ,use this , xtrabackup --prepare --target-dir=/root/fullbak_20221019
and xtrabackup --copy-back --target-dir=/root/fullbak_20221019,this ok
Finally,Modify permissions:chown -R mysql.mysql /data01/mysql-data
but,when start mysql fail!
the error:
● mysql.server.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysql.server; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-10-19 06:33:16 EDT; 7s ago
Docs: man:systemd-sysv-generator(8)
Process: 8761 ExecStop=/etc/init.d/mysql.server stop (code=exited, status=0/SUCCESS)
Process: 18490 ExecStart=/etc/init.d/mysql.server start (code=exited, status=1/FAILURE)
Tasks: 38 (limit: 512)
CGroup: /system.slice/mysql.server.service
├─6248 /bin/sh /opt/mysql/bin/mysqld_safe --datadir=/data01/mysql-data/workdbs --pid-file=/data01/mysql-data/workdbs/linux-…
└─8364 /opt/mysql/bin/mysqld --basedir=/opt/mysql --datadir=/data01/mysql-data/workdbs --plugin-dir=/opt/mysql/lib/plugin -…

Oct 19 06:33:14 linux-yifg systemd[1]: Starting LSB: start and stop MySQL…
Oct 19 06:33:16 linux-yifg mysql.server[18490]: Starting MySQL…2022-10-19T10:33:16.523083Z mysqld_safe error: log-error set to …ysql’.
Oct 19 06:33:16 linux-yifg mysql.server[18490]: The server quit without updating PID file (/data01/mysql-data/workdbs/linux-yifg…failed
Oct 19 06:33:16 linux-yifg systemd[1]: mysql.server.service: Control process exited, code=exited status=1
Oct 19 06:33:16 linux-yifg systemd[1]: Failed to start LSB: start and stop MySQL.
Oct 19 06:33:16 linux-yifg systemd[1]: mysql.server.service: Unit entered failed state.
Oct 19 06:33:16 linux-yifg systemd[1]: mysql.server.service: Failed with result ‘exit-code’.
Hint: Some lines were ellipsized, use -l to show in full.

1 Like

Hi @wangying

Welcome to Percona Forums, and thank you for being part of our community!

With the information you provided, I can’t help you. If you get the full log (-l) option,
you will be able to find the error log:

Oct 19 06:33:16 linux-yifg mysql.server[18490]: Starting MySQL…2022-10-19T10:33:16.523083Z mysqld_safe error: log-error set to …ysql’.

Check the contents of the error log to find the reason for MySQL not starting. If you can’t find it,
please report the significant contents of the error log here, and the versions of MySQL and
XtraBackup used.

Thank you!

1 Like

Hi,you are right! use this -l option,I find reason about this,so I create error.log handly,the mysql can start normal.mysql version and xtrabackup version are all 8.0.28. Thanks for the answer!
the full error log like this:
linux-yifg:/data01/mysql-data/log # systemctl status mysql.server.service -l
● mysql.server.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysql.server; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-10-19 09:01:23 EDT; 1min 56s ago
Docs: man:systemd-sysv-generator(8)
Process: 30489 ExecStop=/etc/init.d/mysql.server stop (code=exited, status=0/SUCCESS)
Process: 32647 ExecStart=/etc/init.d/mysql.server start (code=exited, status=1/FAILURE)

Oct 19 09:01:20 linux-yifg systemd[1]: Starting LSB: start and stop MySQL…
Oct 19 09:01:23 linux-yifg mysql.server[32647]: Starting MySQL…2022-10-19T13:01:23.434992Z mysqld_safe error: log-error set to ‘/data01/mysql-data/log/error.log’, however file don’t exists. Create writable for user ‘mysql’.
Oct 19 09:01:23 linux-yifg mysql.server[32647]: The server quit without updating PID file (/data01/mysql-data/workdbs/linux-yifg.pid)…failed
Oct 19 09:01:23 linux-yifg systemd[1]: mysql.server.service: Control process exited, code=exited status=1
Oct 19 09:01:23 linux-yifg systemd[1]: Failed to start LSB: start and stop MySQL.
Oct 19 09:01:23 linux-yifg systemd[1]: mysql.server.service: Unit entered failed state.
Oct 19 09:01:23 linux-yifg systemd[1]: mysql.server.service: Failed with result ‘exit-code’.

1 Like

So, if you don’t mind, i’ll tag this post as solved. Thank you for your collaboration with the community.

1 Like