Please help me solve this problem that happened to me. I created a database in the DB Databases section

Can you post in comments the output from SSH with CLI of the following command:

journalctl --unit=mariadb.service | tail -n 300

This will give an explaination why the MariaDB server is not starting. Looks like a configuration problem after an update.

1 Like
root@cp:~# systemctl status mariadb
● mariadb.service - MariaDB 10.11.6 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: exit-code) since Fri 2024-08-09 23:11:25 CEST; 2h 38min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 34897 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=e>
    Process: 34907 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=>
    Process: 34909 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd />
    Process: 34917 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSI>
   Main PID: 34917 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"

Aug 09 23:11:25 cp.bazbook.com systemd[1]: Starting MariaDB 10.11.6 database server...
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [Warning] Can't create test f>
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [Note] Starting MariaDB 10.11>
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [ERROR] mariadbd: Can't creat>
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [ERROR] DDL_LOG: Failed to cr>
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [ERROR] Aborting
Aug 09 23:11:25 cp.bazbook.com systemd[1]: mariadb.service: Main process exited, code=exited, statu>
Aug 09 23:11:25 cp.bazbook.com systemd[1]: mariadb.service: Failed with result 'exit-code'.
Aug 09 23:11:25 cp.bazbook.com systemd[1]: Failed to start MariaDB 10.11.6 database server.
lines 1-23/23 (END)`Preformatted text`
root@cp:~# journalctl --unit=mariadb.service | tail -n 300
-- Logs begin at Fri 2024-08-09 20:44:24 CEST, end at Sat 2024-08-10 01:54:01 CEST. --
Aug 09 20:44:25 cp.bazbook.com systemd[1]: Starting MariaDB 10.11.6 database server...
Aug 09 20:44:26 cp.bazbook.com mariadbd[577]: 2024-08-09 20:44:26 0 [Warning] Can't create test file '/var/lib/mysql/cp.lower-test' (Errcode: 13 "Permission denied")
Aug 09 20:44:26 cp.bazbook.com mariadbd[577]: 2024-08-09 20:44:26 0 [Note] Starting MariaDB 10.11.6-MariaDB-1:10.11.6+maria~ubu2004 source revision fecd78b83785d5ae96f2c6ff340375be803cd299 as process 577
Aug 09 20:44:26 cp.bazbook.com mariadbd[577]: 2024-08-09 20:44:26 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
Aug 09 20:44:26 cp.bazbook.com mariadbd[577]: 2024-08-09 20:44:26 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
Aug 09 20:44:26 cp.bazbook.com mariadbd[577]: 2024-08-09 20:44:26 0 [ERROR] Aborting
Aug 09 20:44:26 cp.bazbook.com systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Aug 09 20:44:26 cp.bazbook.com systemd[1]: mariadb.service: Failed with result 'exit-code'.
Aug 09 20:44:26 cp.bazbook.com systemd[1]: Failed to start MariaDB 10.11.6 database server.
Aug 09 23:11:25 cp.bazbook.com systemd[1]: Starting MariaDB 10.11.6 database server...
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [Warning] Can't create test file '/var/lib/mysql/cp.lower-test' (Errcode: 13 "Permission denied")
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [Note] Starting MariaDB 10.11.6-MariaDB-1:10.11.6+maria~ubu2004 source revision fecd78b83785d5ae96f2c6ff340375be803cd299 as process 34917
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
Aug 09 23:11:25 cp.bazbook.com mariadbd[34917]: 2024-08-09 23:11:25 0 [ERROR] Aborting
Aug 09 23:11:25 cp.bazbook.com systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Aug 09 23:11:25 cp.bazbook.com systemd[1]: mariadb.service: Failed with result 'exit-code'.
Aug 09 23:11:25 cp.bazbook.com systemd[1]: Failed to start MariaDB 10.11.6 database server.
root@cp:~#

1. Problem one: cp.lower-test

Execute following commands:

chown -R mysql:mysql /var/lib/mysql
chmod -R 0660 /var/lib/mysql

2. Problem two: ddl_recovery.log

Search for /etc/mysql/mariadb.cnf and make sure that the mysql directory is specified for the datadir as follows:

datadir = /var/lib/mysql

If the above path of mysql is missing, add it immediately one line below the [mysqld].

3. Final check
After executing two steps above, execute on SSH:

systemctl start mariadb
systemctl status mariadb

If the mariadb starts, tell us it you can click on the DB from Hestiacp.

If mariadb throws an error, show the output of the command once again:

journalctl --unit=mariadb.service | tail -n 300

This command does not work

chown -R mysql:mysql /var/lib/mysql
chmod -R 0660 /var/lib/mysql

Nothing happens when I put them on.

Last login: Sat Aug 10 15:49:08 2024 from 46.35.65.100
root@cp:~# chown -R mysql:mysql /var/lib/mysql
root@cp:~# chmod -R 0660 /var/lib/mysql
root@cp:~#

Now I can no longer log in to the hestiacp control panel. It has gotten worse for me from everywhere. Please help me :sob::sob:

the permission set of your server is probaly completly fu*ked up. The commands above does not provide any output, that’s fine.

Please keep in mind, that you should have a decent knowledge how to run a server, we do not have enough ressources to teach you so and its also not the idea behind hestia.

Please check for a paid sysadmin which can help you out or stick to a shared hosting provider.

1 Like

Please tell me how can I login to hestiacp control panel. At least I will make a manual backup of the files. Then I will make a new hestiacp control panel. I don’t have enough experience.
Can you help me give me any commands that I can use to access the hestiacp control panel?

But please consider to get help, this is out of the scope of hestiacp.

I think you need to follow a different solution. @Raphael is very correct. The permissions on several (not just one) has not been functioning differently. The apparmor package is creating a huge problem on your system. Because of this, you had multiple errors.

I think the best for you is to find a different provider, who gives you a VPS plus several snapshots. The suggestion of @Raphael is correct, to make backup an drestore, but that will help you only temporary.

While updating or managing, many errors like this will happen. As you are a beginner and have very little knowledge, you need snapshots of the whole server after you have configured.

If you have several snapshots available to restore the whole server (not just user data), then you can reset the whole server and all the data will be inside, if any.

Just a backup and restore will reset the user data. But twhat will happen when the server is screwed up due to some reasons? That is where snapshots will come to rescue you. Better would be to have five snapshots possibility. They will costs some money but it will be little as compared to the loss of tiome, money and energy you will have to pour in at a later date when many things are messed up like now.

So I advice you to reinstall the entire VPS again and start from scratch, at least for now.

1 Like

The above commands will not give any output. It will simply make sure that the permissions and ownership of the directory mysql is correct. This was necessary because the log file had showed error of permissions.

But now, you cannot loggin and that is totally different error.

You will save a lot of time if you reinstall the entire VPS to new. Then make sure to restore the backups.

Now, you should make backups from SSH of each individual user and download them. Then reinstall the VPS and restore all the backups.

1 Like