Everything has been working well for several months, and today I go to the server and see that the database is not running, and does not want to start and gives an error… I urgently need to solve this problem so as not to lose the database of my site(
I need to export one database, I can see it, but it is in a folder, and I need to somehow convert the dump to sql, since I have already transferred my site to another working server
> /forcefsck
reboot
# then after reboot
journalctl -t systemd-fsck
result:
root@DietPi:~# journalctl -t systemd-fsck
-- Journal begins at Wed 2022-07-20 15:02:30 EEST, ends at Wed 2022-07-20 15:03:32 EEST. --
-- No entries --
root@DietPi:~#
I tried this command mysqldump -u username -p database_name > data-dump.sql
but
Enter password:
mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)" when trying to connect
root@DietPi:~#
It might not be possible to export the database as the database server is not starting at the moment. According the log files you shared, it might be possible to set some flags to force the database to startup. MySQL :: MySQL 8.0 Reference Manual :: 15.21.3 Forcing InnoDB Recovery
Probably you would need to reach out to some MariaDB specialized boards for deeper database support.
What if I make a copy of the contents of folder /mnt/dietpi_userdata/mysql, then delete mariadb and reinstall, and then copy the database folders back to /mnt/dietpi_userdata/mysql?
Is it possible to restore the database dump like this?
The problem is the files inside your database folder mysite@002dsite. Looks like MariaDB is not able to read these files anymore. Therefore the database server is not starting atm. Moving the files back in place on a new install will most probably result on the same. Therefore you could set force recovery option within MariaDB server configuration file. This should allow to start the database eninge. And maybe you are able to export this specific database later on.
Another option is to copy these specific mysite@002dsite folder away to a save place and try to start MariaDB afterwards. Maybe this will bring back Nextcloud at least.
yes, but that didn’t solve the problem. I am sure that the problem there is not because of this database, there is a site on modx without errors at all, I have its analogue working on another server and everything is perfect.
I made a copy of /mnt/dietpi_userdata/mysql and will now reinstall mariaDB
I reinstalled cleanly MariaDB, created a database and a user with the same name and password, then copied the previously saved files to the folder /mnt/dietpi_userdata/mysql/mysite@002dsite/, and I get the following message in webmin((
Is it impossible for me to recover a dump of this database? I know for sure that she is working