• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 863
  • Last Modified:

How to get list of Innodb tables in a MySQL database

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
gmanpert
Asked:
gmanpert
  • 2
  • 2
1 Solution
 
racekCommented:
SELECT * FROM information_schema.`TABLES` where enging = 'InnoDB'
0
 
racekCommented:
:-)
SELECT * FROM information_schema.`TABLES` where ENGINE = 'InnoDB'
0
 
Hube02Commented:
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
 
Hube02Commented:
Sorry, missed the InnoDB protion of the question. Better to go with racek.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now