Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I had a MySql database with a few InnoDB tables. After restarting the server, and starting MySql Server again, I connected to the MySql Server using MySql Workbench, and couldn't see the database at all (it even doesn't show up empty, it's just not there). It's important to note that the server was brutally shut down (I had no choice), so maybe MySql Server wasn't closed normally, and it caused a problem.

I am new to MySQL area with innoDB. Any help is really appreciated.

Thank you in advance.

Regards, Ron

share|improve this question
1  
If MySQL is running, please run SHOW ENGINES; and look for the row with InnoDB. Look at the Support column. Does it say YES, NO, DEFAULT, or DISABLED ??? –  RolandoMySQLDBA Jan 14 at 18:25
    
@RolandoMySQLDBA It says DEFAULT. –  user3194907 Jan 14 at 18:50
1  
Run show variables like 'datadir';. What does it say ??? –  RolandoMySQLDBA Jan 14 at 18:55
    
It says: C:\Program Files\MySQL\MySQL Server 5.7\data\, but I checked and saw that my database isn't there... –  user3194907 Jan 14 at 19:01
    
Oh you are running MySQL for Windows. Please run this query: select table_schema DB,SUM(data_length)/POWER(1024,2) DAT,SUM(index_length)/POWER(1024,2) NDX ,SUM(data_length+index_length)/POWER(1024,2) DBSIZE FROM information_schema.tables WHERE table_schema NOT IN ('informatio_schema','mysql') GROUP BY table_schema;. It should return how much data the MySQL Instance can see IN Gigabytes. What does it return? Another question: Did you have MySQL 5.6 running before ??? –  RolandoMySQLDBA Jan 14 at 19:03

2 Answers 2

Using the server admin section on the right hand side of workbench can you see if the MySQL server is running? Using the workbench server admin can you check/test connections? Have you viewed the server logs (from the same menu)?

I don't know that a shutdown of a running server should cause all the data to go missing. Far more likely is that your MySQL workbench isn't pointing to the correct directories. Using the 'manage server instances' check the path to the ini files. Have a look in the MySQL DATA directory - just as a quick check that there is a database there!

I must say workbench isn't as good as the old admin front end but it should give you a fair amount of information.

share|improve this answer
    
Well, the data directory doesn't have my database in there. It's super strange, but it seems like my database is gone. Luckily, I have a backup. –  user3194907 Jan 14 at 18:59

If you have MySQL 5.6 running before, then the MySQL data is located in C:\Program Files\MySQL\MySQL Server 5.6\data\

If you had recently installed MySQL 5.7, that instance has its own MySQL data in C:\Program Files\MySQL\MySQL Server 5.7\data\.

You need to migrate the data from MySQL 5.6 into MySQL 5.7.

If you are not sure what what version of MySQL was actually running on your Windows Server, here are two things you must investigate:

INVESTIGATION #1

  • Goto to Windows Explorer
  • Navigate to C:\Program Files\MySQL

INVESTIGATION #2

  • For every folder under C:\Program Files\MySQL
    • Go inside the subfolder MySQL 5.x
    • Locate the file my.ini

Whichever folder has my.ini was in the installed version of MySQL

If none of them has my.ini, you have to dig a little deeper

INVESTIGATION #3

  • Click Start -> Control Panel -> Administrative Tools -> Services
  • Once the Services panel is open, scroll down alphabetically to MySQL.
  • Right click on MySQL
  • Choose Properties

This will show you the path to the MySQL binary it called and the my.ini associated with it. If it does not show a my.ini, then the my.ini should appear in the parent directory of the executable.

If this does not work, then you will have to look inside MySQL Workbench for the original connection settings you were connecting with.

share|improve this answer
    
None of those directories have the MySQL data that disappeared. –  user3194907 Jan 14 at 19:13
    
Have you tried doing a full file system search for the file "ibdata1"? In case the server had a custom datadir previously. –  Safado Jan 14 at 20:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.