MySQL: Difference between revisions

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
<syntaxhighlight lang="sql">ALTER TABLE MYTABLE ENGINE=InnoDB;
<syntaxhighlight lang="sql">ALTER TABLE MYTABLE ENGINE=InnoDB;
ALTER TABLE MYTABLE ENGINE=MyISAM;</syntaxhighlight>
ALTER TABLE MYTABLE ENGINE=MyISAM;</syntaxhighlight>
* Unlock replication (ex: Duplicate Key):
SET GLOBAL sql_slave_skip_counter = 1; start slave;

Revision as of 11:11, 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;
ALTER TABLE MYTABLE ENGINE=MyISAM;
  • Unlock replication (ex: Duplicate Key):

SET GLOBAL sql_slave_skip_counter = 1; start slave;