3

I created a test database for a CakePHP tutorial I'm working through, and just used phpMyAdmin's default settings for the engine (MyISAM.) Now that I'm several days into the tutorial, it indicates that to use some of the features, the tables need to use InnoDB.

Is it possible (either in phpMyAdmin itself or via a SQL file import) to change the tables' engine choice after they've already been created? They currently have data in them, but it's only a few records each so I don't care if I have to empty the tables out. I just don't want to have to completely recreate the tables, if at all possible.

I can't seem to find any way to do this in phpMyAdmin - the only place I can find a choice of engines is when I'm creating a brand-new table.

EDITED TO ADD SCREENSHOT AFTER RUNNING QUERY: alt text

1 Answer 1

7

Use this query:

ALTER TABLE my_table ENGINE = InnoDB;

where "my_table" is your table name.

In phpMyAdmin, navigate to the table and click the "SQL" tab at the top. Then paste the above query and click "Go/Execute".

2
  • Question: it did update all the existing tables, but when I look at the database summary it still shows MyISAM in the "totals" row. (Screenshot added to original post.) Is this a problem?
    – EmmyS
    Commented Jan 21, 2011 at 15:16
  • 1
    Nope, not a problem. That's just the default for new tables.
    – ceejayoz
    Commented Jan 21, 2011 at 15:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.