• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 866
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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