Solved

How to get list of Innodb tables in a MySQL database

Posted on 2009-05-05
4
860 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Creating and Managing Databases with phpMyAdmin in cPanel.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

624 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