Mysql – Why thesql-noinstall5.6.x.zip includes ibdata file

MySQLmysql-5.6windows

English is not my main language, please feel free to correct me or ask for clarification or a different explanation.

I've been messing around with MySQL for Windows and trying to understand how it works. Right now I'm working with MySQL 5.5 and 5.6 using the no-install.zip version and following the steps explained in the manual to get them both to work.

Any versión(¿subversion?) of MySQL 5.5.x (i.e., 5.5.12, 5.5.62) includes the data folder and only three folders inside it (mysql, performance_schema and test). I decompressed the zip, generated a my.ini file and ran the server. It created the ibdata and log-files and everything worked fine.

As for MySQL 5.6.x, it also includes the data folder with the same three folders as MySQL 5.5 but it already has the ibdata and log files (I downloaded different subversions just to make sure, and the files are present in all of them). So I followed the same process as for MySQL 5.5: I decompressed the zip, generated a my.ini file and ran the server, everything worked as expected.

Just for the knowledge's sake I deleted everything to make a clean start. Decompressed again the MySQL 5.6 zip file but this time I deleted the default ibdata and log-files and ran the server and it worked… aparently. It created the ibdata and log-files. But it lost some information from the mysql database. For example, I can no longer check the innodb_index_stats table using a select nor a describe query.

Now, my questions:

  1. Why does the MySQL 5.6 zip file includes default ibdata and log-files?
  2. What does those default files contain?
  3. I'm fully aware that deleting the ibdata file erases the information and it's the reason the server is missing some data. But, why when they are created from scratch they miss this information? Isn't the server supposed to create them with full default information just as MySQL 5.5 does?

I already tried to answer those question but I couldn't find anything useful. I slightly read the first MySQL 5.6 release notes and randomly others between the first and last but didn't find any explanation on why it does include default files.
I also searched in Google about ibdata file but the answers are more in the sort of how to recover/backup/dump information from damaged ibdata or how to shrink it.

So, why? 🙂

Best Answer

To give you an more extensive answer, inno_db stores these data

data dictionary aka metadata of InnoDB tables
change buffer
doublewrite buffer
undo logs

so there is a lot of information and it can get really big.

so mysql 5.6 stores there data, that it needs when it is restarted, and 5.5 doesn't.