• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 44
  • Last Modified:

MySQL Datafiles On CentOS 7

Hello guys,
For data restore reasons i wanna know exact data files location and there filename extention.

Which files are then sufficient to restore a mysql database on onother Linux Machine?

Please Help
0
mos1234
Asked:
mos1234
  • 3
2 Solutions
 
gheistCommented:
/var/lib/mysql/*
There are multiple files in there.
File backup is only valid if mysqld is completely stopped.
Normally you would want to pipe mysqldump output to backup system pipe.
0
 
mos1234Author Commented:
does it mean that if MySQL is running and the hardware crashes theres no chance for recovery from files retrieved someway from the storage?.....
0
 
gheistCommented:
You can make transaction-accurate replica and make backups with or without shutdown from that.
Bonus - it can be used as read-only database too.

Why - you make mysqldump backups. Image backups will not work with any open database.
0
 
Tomas Helgi JohannssonCommented:
Hi!

All data that has been commit-ed to disk would be recoverable if the files are accessible and not corrupted after you reboot and/or mount the disk where the database is located.
You would need to recover all /var/lib/mysql/ directory to a new location and start mysql on that location. If you get a successfull startup then you could do mysqldump (backup) of the data to be restored on a "clean" and fully functional server.
What I recommend is that you have a master-slave / replication setup for disaster recovery as well as backups to minimize recovery time on your database especially on mission critical databases.

Regards,
     Tomas Helgi
0
 
gheistCommented:
Thats life
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now