Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

What Is the information_schema Database?

This guide explains the special database called information_schema and how to look inside it.

Databases2 min read4 steps1 screenshots

What is it?

MySQL is a database system. It holds your data in tables. A table is like a spreadsheet page. A schema is the plan of how data is organised. It lists the tables and the columns in each table.

information_schema is a built-in database. It holds facts about all your other databases. Think of it as the library catalogue. It does not hold books. It tells you where the books are and what they are about.

You cannot change it. It is read-only. MySQL fills it in for you.

Why look at it?

  • To list all the tables in a database.
  • To see the columns in a table.
  • To find how big a database is.
    Screenshot: To find how big a database is.
  • To see which users have which rights.

Tables inside it

TableWhat it tells you
SCHEMATAAll the databases
TABLESAll the tables and their sizes
COLUMNSAll the columns in all tables
STATISTICSIndex details. An index is like a book's index; it speeds up searches.

Steps: look at it in phpMyAdmin

  1. Log in to your control panel and open phpMyAdmin.
  2. Click information_schema in the left list.
  3. Click a table, such as TABLES, to see its rows.
  4. Or click the SQL tab and type a question, as shown below.

This question lists the tables of one database.

SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'mydatabase';

Replace mydatabase with your database name.

This one shows the size of each database in megabytes.

SELECT TABLE_SCHEMA, ROUND(SUM(DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024, 2) AS size_mb
FROM information_schema.TABLES
GROUP BY TABLE_SCHEMA;
Tip: On shared hosting you only see your own databases. This is normal and keeps others' data private.

Quick recap

  • information_schema is MySQL's own catalogue of your databases.
  • It is read-only. Do not try to edit it.
  • Use TABLES and COLUMNS to find names and sizes.
  • Open it in phpMyAdmin or query it with SQL.