gmanpert
asked on
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
I hosed my ibdata files and need to figure out which tables are Innodb so I can restore them from a backup file.
-G
SELECT * FROM information_schema.`TABLES ` where enging = 'InnoDB'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
?>
Sorry, missed the InnoDB protion of the question. Better to go with racek.