-4

Due to a failed update, now my VPS system is broken. I can only access to my files with rescue mode. So, where does MariaDB store his .sql files? So I can make a backup.

The update was made by my vps provider. And they didn't said to me that they would have update my system. And my last backup was some days ago. The site on my VPS was still under development, so I made changes every days.

peterh
  • 4,953
  • 13
  • 30
  • 44

2 Answers2

4

Somehow Google knew this already as first result on search mariadb file location:

The data directory location is controlled by the datadir variable. Look at your /etc/mysql/my.cnf file to see where your installation of MariaDB is configured to store data. The default is /var/lib/mysql but it is often changed, like for example if you are using a RAID array.

Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129
-1

There is no database on the world which had its data in .sql files. They use their highly optimized binary format. It is in most cases in /var/lib/mysql, but it depends a lot from your actual distribution and even from your server environment.

You can easily find out, where are the actual database by asking their list with an lsof -p <pid> command of your database process. Its pid you can find out by a top or by a ps uxa command.

But it won't help in your case. You need to recover your database:

  1. Start your db in rescue mode,
  2. Dump everything out with a mysqldump -A
  3. Stop the db,
  4. Delete (or save for later deeper analyze/recover) your broken database files,
  5. Reinit your db, and import everything back.

After that, your db will work, but probably a part of your data will be lost. It is a 'funny' thing to merge the actual, but recovered and partially broken data with your backup :-) Good luck :-)

peterh
  • 4,953
  • 13
  • 30
  • 44