MySQL: Difference between revisions

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Jump to navigation Jump to search
(Replaced content with "* List MySQL tables engines for a MYDB database: <syntaxhighlight lang="sql"> SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'MYDB' AND ENG...")
No edit summary
Line 4: Line 4:
SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'MYDB' AND ENGINE IS NOT NULL ORDER BY ENGINE;
SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'MYDB' AND ENGINE IS NOT NULL ORDER BY ENGINE;
</syntaxhighlight>
</syntaxhighlight>
* Change engine for a MYTABLE table:
<syntaxhighlight lang="sql">ALTER TABLE MYTABLE ENGINE=InnoDB;</syntaxhighlight>
OR
<syntaxhighlight lang="sql">ALTER TABLE MYTABLE ENGINE=MyISAM;</syntaxhighlight>

Revision as of 10:52, 16 April 2015

  • List MySQL tables engines for a MYDB database:
SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'MYDB' AND ENGINE IS NOT NULL ORDER BY ENGINE;
  • Change engine for a MYTABLE table:
ALTER TABLE MYTABLE ENGINE=InnoDB;

OR

ALTER TABLE MYTABLE ENGINE=MyISAM;