What is "information_schema" doing in my database?


I setup a database some time ago for my blog. Everything went smoothly, and it’s still going fine. A couple weeks ago I setup another database for another, exact same steps, and it runs fine, still going strong. But I checked mysql.myseconddomain.com and for the first blog there is only 1 database (the wordpress one), but for the second one there are two, one is wordpress’ and the other is “information_schema”.

So when did information_schema get created? What is it for? Can I delete it? How?



Information_scheme are system tables which define your database… you can use these tables to look at what your database layout.


I can use it for what exactly?


Probably the best bet is to read about this MySql 5 feature here complete with an example of it’s use.



Don’t delete it. It is a better alternative to things like SHOW TABLES. The idea is that everything should be represented in tables, so you can extract a list of tables in your database with:SELECT table_name FROM information_schema.tables;You will notice some system-related tables, as well as self-created tables.

Simon Jessey
Keystone Websites | si-blog