MySQL not seeing my database fully after restoration from backup

I reinstalled XAMPP which included MySQL. Prior to the reinstall, I made a backup of the 'C:\xampp\mysql\data' subdirectory, which is where all the databases are stored.

When the new install finished, I copied back the databases in the 'data' subfolder into 'c:\xampp\MySQL\data'. I then went to MySQL Workbench to see if I can access any of them. Refreshing the view made all the databases appear, but when I do a SELECT on any of the tables in any of those databases, I keep getting a message that says the table does not exist, so apparently something is wrong.

How can I make the new install of MySQL see my databases as it used to? Thanks.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan CraciunIT ConsultantCommented:
Using phpmyadmin or Mysql Workbench, repair the tables (in phpmyadmin it's under "Operations" in table view, or under Structure->With Selected->Repair table in db view).

elepilAuthor Commented:
To Dan Craciun.

When I click on the database on the left, I can see the table names, but nothing is showing on the main panel to the right.

I tried following your instructions on another database that I know is good, and it listed all the tables in the main panel, but not for the ones I'm having problems with.

You'd think since MySQL neatly bundles up a database in its own folder in c:\xampp\mysql\data, that just backing up the folder would contain all the info MySQL needs to recognize it.

What is the proper way of backing up a database so that one can restore it with confidence that it will be readable by MySQL, do you know?
Dan CraciunIT ConsultantCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

elepilAuthor Commented:
I guess I learned my lesson, I should backup these databases. I think I've lost them for good. Thanks for your help.
Dan CraciunIT ConsultantCommented:
Are these used for production or development?

XAMPP is great for quick deploy when developing an app/site, but I would not use it in production.

And even for development/testing, a Raspberry PI is cheap and small (about the size of a pack of cards).
Just install Raspbian and Mysql and you have your own dedicated server.

Make sure you save an image of your SD card from time to time (they tend to wear out after a while, in my experience).

Anyway, any solution you use, make sure you have an automated method for daily backups. If you have to do it manually you'll forget.
elepilAuthor Commented:
The databases I lost were still in development, and they didn't have too much data yet. But I'm good. Thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.