Where can i find the MySQL database file in Linux Filesystem
I'm an MS Access user for several years, then I switch to MySQL. I know how to backup and restore the database in MySQL in a Linux environment, but it only works when the MySQL daemon is running. One time, our server (SuSE Linux 9.3 Prof) crashes, and I can't run all the services, and one of them is MySQL, so I have trouble making backup of our School's Forum.
I tried to search the entire filesystem to find the exact file where my tables are located but I'm not sure what i'm doing. I noticed, in Windows, MySQL tables are saved as .frm files, ex. msgboard.frm.
So here are my questions:
1. What directory the MySQL database is stored (in Linux of course)?
2. If ever i find those files, is there any commands to restore those database file to another system? In windows, I copied and paste it, but it doesn't work of course. is there a way on restoring those files? (not mysqldump files)
Another: I have some trouble in restoring my backups. When I make backup, i used this command.
mysqldump db_name -u root -p > our_db_backup.sql
And when i need to restore the database, i need to append the name of the database to all tables of the entire SQL script like this:
create table 'table_name' ...
create table 'db_name'.'table_name' ....
so that this restoration works:
mysql -u root -p < our_db_backup.sql
Is there any way so that I don't have to edit the SQL script evertime i need to restore the database? I think there's a switch lacking.
I really appreciate your help. Thank you.