I was looking for ibdata1 file size but got wondered by seeing it just 11MB. There is also another folder by name manu which is same as database name and it is 15GB. ( on my local machine)
I looked into live server and their it is quite opposite!
ibdata1 file is 128 GB and folder having .frm + .MYD +.MYI files size was less.
If I look for statistics (local machine)-
manu DB is 15GB
ibdata1 is 11MB
and along with this, in folder ‘manu’, every table has 3 files – (just for an example: table NEWS).
NEWS.frm
NEWS.MYD
NEWS.MYI
many times I have dropped all the tables from ‘manu’ (on my local) and recreated table.
My question is- why the live DB has everything in ibdata (I assume ibdata1 will contain all data what we see in mysql tables) and why on live ibdata1 is very less and files related to them are large in size. Is it not storing all the data in ibdata1 on my local?
What may be the issue.
Actually I wanted to rebuild the DB and set innodb_file_per_table since many deleted table have not released the space and DB size is growing bigger.
This is because your local server uses a different engine for tables than your live server.
When tables are of engine InnoDB their data is stored in ibdata1, when they are stored in .MY* files they are of engine MyISAM.
In a database there can be even a mix of tables with different engines.
The main difference is, that InnoDB is capable of transactions. Which means that statements can get reverted when anything fails, while this is not possible with MyISAM.
A default engine for newly created tables can be specified when creating the database. I guess that happened in your case. You can simply dump your tables and in the created backup script you can replace the engine at the end of each
CREATE TABLEstatement. Then insert the data again and you’re fine.