Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not sure if this is the right subforum, but here it is.
After automatic update of mysql, I lost all tables in a database. I can't see them from console or phpMyAdmin. But when I go to /var/lib/mysql there it is 300MB directory. What happend and how can I get this database back?
I tried repairing with mysqlcheck, but nothing happened.
Automatic update is performed by cPanel and I guess it executes that command after updates. Nevertheless, I just tried with those and still nothing. No tables. Perhaps it wasn't due to update, but I have no idea why this happened.
Since all .frm files were gone, I managed to find some old backup. I restored old backup and that way restored tables definition. Then I copied new .MYD and .MYI over this restored, while retaining .frm's. Last step was repairing database with mysqlcheck -r and everything was working like before.
Yep, that was the next step. Restoring the actual .MYI and .MYD files is sketchy but it can work. The fact that you were getting no info when doing the query against your info schema table confirms that the issue is with your .frm files which tell the MySQL database your table info. Just wanted to add this follow up for anyone else that runs into the issue. This is the last step you can attempt before you are up the creek so to speak.
Without any one of the files(.frm, .MYI, .MYD) it would be impossible to restore. It is good practice to setup a cron job to make a mysqldump of your databases for backup purposes.
Without any one of the files(.frm, .MYI, .MYD) it would be impossible to restore. It is good practice to setup a cron job to make a mysqldump of your databases for backup purposes.
It's even better practise to replicate them to a slave server and take backups from the slave
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.