Solved

How to get list of Innodb tables in a MySQL database

Posted on 2009-05-05
4
858 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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