Erro de Inicialização MariaDB

SQL

MySQL

Linux

MariaDB

14/03/2024

Bom dia/Boa tarde/ Boa noite!

Utilizo o MariaDB como o banco de dados do GLPI, recentemente o programa começou a apresentar erro de desconexão com banco. Após fazer uma análise do que estava ocorrendo, encontrei um erro com o serviço do MariaDB, sendo ele:

root@SVGLPI:~# sudo service mysqld start
Job for mariadb.service failed because of unavailable resources or another system error.
See "systemctl status mariadb.service" and "journalctl -xe" for details.


A principio o erro foi resolvido renomeando o arquivo ib_logfile0 de log do MySql em /var/lib/mysql/, porem o problema foi resolvido por um dia, no outro voltou a ocorrer e não funcionou mais. vou deixar o resultado do "systemctl status mariadb.service" and "journalctl -xe" abaixo, alguem pode me dar uma luz?


oot@SVGLPI:~# systemctl status mariadb.service
● mariadb.service - MariaDB 10.5.23 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
     Active: failed (Result: resources) since Thu 2024-03-14 09:27:04 -03; 4h 2>
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
      Tasks: 5 (limit: 6899)
     Memory: 71.6M
        CPU: 5h 40.556s
     CGroup: /system.slice/mariadb.service
             └─734 /usr/sbin/mariadbd

mar 14 13:46:48 SVGLPI systemd[1]: mariadb.service: Failed with result 'resourc>
mar 14 13:46:48 SVGLPI systemd[1]: mariadb.service: Unit process 734 (mariadbd)>
mar 14 13:46:48 SVGLPI systemd[1]: Failed to start MariaDB 10.5.23 database ser>
mar 14 13:51:11 SVGLPI systemd[1]: mariadb.service: Found left-over process 734>
mar 14 13:51:11 SVGLPI systemd[1]: This usually indicates unclean termination o>
mar 14 13:51:11 SVGLPI systemd[1]: mariadb.service: Will not start SendSIGKILL=>
mar 14 13:51:11 SVGLPI systemd[1]: mariadb.service: Failed to run 'start-pre' t>
mar 14 13:51:11 SVGLPI systemd[1]: mariadb.service: Failed with result 'resourc>
mar 14 13:51:11 SVGLPI systemd[1]: mariadb.service: Unit process 734 (mariadbd)>
mar 14 13:51:11 SVGLPI systemd[1]: Failed to start MariaDB 10.5.23 database ser>


root@SVGLPI:~# journalctl --since=yesterday -u mariadb
-- Journal begins at Sat 2023-07-22 17:39:01 -03, ends at Thu 2024-03-14 14:08:>
mar 14 00:00:25 SVGLPI systemd[1]: mariadb.service: Main process exited, code=k>
mar 14 00:00:25 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 00:00:25 SVGLPI systemd[1]: mariadb.service: Consumed 42min 58.631s CPU >
mar 14 00:00:30 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, rest>
mar 14 00:00:30 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 00:00:30 SVGLPI systemd[1]: mariadb.service: Consumed 42min 58.631s CPU >
mar 14 00:00:30 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 00:01:02 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 00:01:05 SVGLPI debian-start[281551]: ERROR 1045 (28000): Access denied >
mar 14 00:29:15 SVGLPI systemd[1]: mariadb.service: Main process exited, code=k>
mar 14 00:29:15 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 00:29:15 SVGLPI systemd[1]: mariadb.service: Consumed 5min 7.735s CPU ti>
mar 14 00:29:20 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, rest>
mar 14 00:29:20 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 00:29:20 SVGLPI systemd[1]: mariadb.service: Consumed 5min 7.735s CPU ti>
mar 14 00:29:20 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 00:29:27 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 00:29:27 SVGLPI /etc/mysql/debian-start[282250]: Upgrading MySQL tables >
mar 14 00:29:27 SVGLPI debian-start[282262]: ERROR 1045 (28000): Access denied >
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Main process exited, code=k>
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Consumed 5min 35.439s CPU t>
lines 1-23...skipping...
-- Journal begins at Sat 2023-07-22 17:39:01 -03, ends at Thu 2024-03-14 14:08:01 -03. --
mar 14 00:00:25 SVGLPI systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
mar 14 00:00:25 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 00:00:25 SVGLPI systemd[1]: mariadb.service: Consumed 42min 58.631s CPU time.
mar 14 00:00:30 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 259.
mar 14 00:00:30 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 00:00:30 SVGLPI systemd[1]: mariadb.service: Consumed 42min 58.631s CPU time.
mar 14 00:00:30 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 00:01:02 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 00:01:05 SVGLPI debian-start[281551]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N>
mar 14 00:29:15 SVGLPI systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
mar 14 00:29:15 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 00:29:15 SVGLPI systemd[1]: mariadb.service: Consumed 5min 7.735s CPU time.
mar 14 00:29:20 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 260.
mar 14 00:29:20 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 00:29:20 SVGLPI systemd[1]: mariadb.service: Consumed 5min 7.735s CPU time.
mar 14 00:29:20 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 00:29:27 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 00:29:27 SVGLPI /etc/mysql/debian-start[282250]: Upgrading MySQL tables if necessary.
mar 14 00:29:27 SVGLPI debian-start[282262]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N>
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Consumed 5min 35.439s CPU time.
mar 14 01:27:00 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 261.
mar 14 01:27:00 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 01:27:00 SVGLPI systemd[1]: mariadb.service: Consumed 5min 35.439s CPU time.
mar 14 01:27:00 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 01:27:04 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 01:27:05 SVGLPI /etc/mysql/debian-start[283869]: Checking for insecure root accounts.
mar 14 01:27:05 SVGLPI debian-start[283872]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N>
mar 14 02:30:36 SVGLPI systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
mar 14 02:30:36 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 02:30:36 SVGLPI systemd[1]: mariadb.service: Consumed 5min 35.164s CPU time.
mar 14 02:30:41 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 262.
mar 14 02:30:41 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 02:30:41 SVGLPI systemd[1]: mariadb.service: Consumed 5min 35.164s CPU time.
mar 14 02:30:41 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 02:30:44 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 02:30:44 SVGLPI /etc/mysql/debian-start[285432]: Upgrading MySQL tables if necessary.

Bruno

Bruno

Curtidas 0

Respostas

Arthur Heinrich

Arthur Heinrich

14/03/2024

A primeira mensagem estava clara:

mar 14 13:46:48 SVGLPI systemd[1]: Failed to start MariaDB 10.5.23 database ser>
mar 14 13:51:11 SVGLPI systemd[1]: mariadb.service: Found left-over process 734>

O serviço do banco já estava no ar, através do processo 734.

Depois, no log, vemos que ocorreu um restart:

mar 14 00:29:20 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.
mar 14 00:29:20 SVGLPI systemd[1]: mariadb.service: Consumed 5min 7.735s CPU time.
mar 14 00:29:20 SVGLPI systemd[1]: Starting MariaDB 10.5.23 database server...
mar 14 00:29:27 SVGLPI systemd[1]: Started MariaDB 10.5.23 database server.
mar 14 00:29:27 SVGLPI /etc/mysql/debian-start[282250]: Upgrading MySQL tables if necessary.

O banco foi parado e reiniciado, novamente, aparentemente com sucesso.

Porém, ao acessar o banco com o usuário root@localhost, faltam permissões:

mar 14 01:27:05 SVGLPI /etc/mysql/debian-start[283869]: Checking for insecure root accounts.
mar 14 01:27:05 SVGLPI debian-start[283872]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N>

Aí parece que alguém deu um kill no processo do banco:

mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Failed with result 'signal'.
mar 14 01:26:55 SVGLPI systemd[1]: mariadb.service: Consumed 5min 35.439s CPU time.
mar 14 01:27:00 SVGLPI systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 261.
mar 14 01:27:00 SVGLPI systemd[1]: Stopped MariaDB 10.5.23 database server.

Não sei se é o seu caso, mas pode ser que o usuário "root@localhost" tenha sido excluído e, por isso, não esteja funcionando.

Segue uma página sobre isso:

https://stackoverflow.com/questions/6085455/restoring-deleted-root-user-and-password-for-mysql
GOSTEI 0
POSTAR