Solved

How to get list of Innodb tables in a MySQL database

Posted on 2009-05-05
4
853 Views
Last Modified: 2012-08-13
Anyone know a quick way to generate a list of Innodb tables in a database?
I hosed my ibdata files and need to figure out which tables are Innodb so I can restore them from a backup file.

-G
0
Comment
Question by:gmanpert
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:racek
ID: 24307202
SELECT * FROM information_schema.`TABLES` where enging = 'InnoDB'
0
 
LVL 14

Accepted Solution

by:
racek earned 500 total points
ID: 24307210
:-)
SELECT * FROM information_schema.`TABLES` where ENGINE = 'InnoDB'
0
 
LVL 18

Expert Comment

by:Hube02
ID: 24307218
I would use something like the attached code. Assumes you are already connected to the DB
<?php  

  

  $query = 'SHOW TABLES';

  if ($results = mysql_query($query)) {

    $success = true;

    $tables = array();

    if (mysql_num_rows($results) > 0) {

      while ($row = mysql_fetch_row($results)) {

        $tables[] = $row[0];

      }

    }

  }

  

  // the array $tables now holds a list of tables in the database

    

  

?>

Open in new window

0
 
LVL 18

Expert Comment

by:Hube02
ID: 24307232
Sorry, missed the InnoDB protion of the question. Better to go with racek.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now