Hello,

I have recently noticed a separate database called "Information Schema" being created in my Drupal 6 installations and it mystifies me...

Can anyone explain in simple terms the following:

  • What is the database for?
  • How is it created?
  • Why can data not be imported?
  • If it is deleted will it be recreated by the modules?
  • If you move your site to a new host, what do you do with the "Information Schema" database? Can it be moved or is it recreated?

That's it for now..

Thanks in advance to anyone who can clear this up for me..

Regards

David Brix

Comments

aitala’s picture

That's not part of Drupal - its part of your web host's MySQL setup. You should not touch it and probably cannot edit/update it anyway.

Eric

__________
Eric Aitala - ema13@psu.edu
Penn State

224b8605113373e086cb27708ff301ba18ce394db1996e7e22928e4555e0d20b1b6cecc7f67c9bd9e536cb915779c485

vukninic’s picture

It's a database created automatically and you shouldn't change it (or edit).
Don't bother with it, it is on every server and if you move your site to a new server you should export only your drupal db.
It's not part of drupal install.

Srdačan pozdrav,
Vuk Ninić

socialnicheguru’s picture

thanks for this.

I have several entries for information_schema in my mysql slow table log.

Is this just something I need to live with or is there some way for me to speed it up?

Thanks.

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.

socialnicheguru’s picture

I am doing some server tuning and noticed a number of entries in my slow mysql log file (at the bottom)

This command was being called "select concat('select count(*) into @discard from"

This seems to be used in Mysql to check for crashed tables.

check_for_crashed_tables – This check is somewhat misleading in that while it suggests that it checks for crashed tables, in fact it only does it for MyISAM tables. It gets a list of all MyISAM tables from the information_schema and for each table does a select count(*) into @discard from database.table. If any tables are corrupt, the select will output an error; these are captured and emailed to the root user. In theory, this should be a relatively simple operation since MyISAM maintains row counts in the meta-data for each table, but in fact, if there are many tables, this may cause some I/O spikes on the server.

http://www.pythian.com/news/3794/mysql-on-debian-and-ubuntu/


Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
# Time: 110129 10:40:43
# User@Host: root[root] @ localhost []
# Query_time: 102.373399  Lock_time: 0.006828 Rows_sent: 1  Rows_examined: 8110
SET timestamp=1296315643;
SELECT ENGINE,SUM(DATA_LENGTH),COUNT(ENGINE) FROM information_schema.TABLES WHERE 
TABLE_SCHEMA NOT IN ('information_schema','mysql') AND ENGINE IS NOT NULL GROUP BY
 ENGINE ORDER BY ENGINE ASC;
/usr/sbin/mysqld, Version: 5.1.37-1ubuntu5.5-log ((Ubuntu)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
# Time: 110129 10:41:17
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 23.270950  Lock_time: 0.000142 Rows_sent: 8134  Rows_examined: 8159
SET timestamp=1296315677;
select concat('select count(*) into @discard from `',
                    TABLE_SCHEMA, '`.`', TABLE_NAME, '`') 
      from information_schema.TABLES where ENGINE='MyISAM';
# Time: 110129 10:41:45
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 25.393761  Lock_time: 0.001732 Rows_sent: 0  Rows_examined: 8156
SET timestamp=1296315705;
select count(*) into @discard from `information_schema`.`PARTITIONS`;

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.

BozHogan’s picture

I agree with most of what's been said, except for the tone of it. True, it's part of MySQL, not drupal. It's the database MySQL uses to manage and keep track of all the other databases, tables, and columns and such that you create, including the ones the Drupal creates. If you know, or are interested in databases and what's going on behind the scenes, you shouldn't be afraid of looking at it. For instance, at the mysql prompt, try this:

mysql>use information_schema
mysql>show tables;
this shows you all the tables in the information_schema database = lots of interesting stuff
mysql>desc tables
this shows you all the columns in the table named "tables"
mysql>select table_name from tables where table_schema = "your drupal dbname here";  (quotes included)
this will give you a listing of all the tables in your drupal database

That's just the tip of the iceberg, there's tons more you can find out about your databases.

They are right though. Only use select and describe statements. Don't change anything or you could hose your whole MySQL server install, and all your Drupal stuff right along with it. I'm not sure if it will even allow you to change anything, although I would guess it will. I'm not going to test that theory out, though. Too risky. :)

Anyway, if you know SQL, looking at the information_schema database can give you all kinds of interesting info. As a PHP coder, I'm in looking at that database at least once or twice a week. Operative phrase is "looking at", never mucking around in. Although I'm thinking of doing a fresh MySQL install on another machine, just to see what trouble I can cause on something with nothing to lose. Thanks for the idea!

Regards,
Boz Hogan