MySQL/MariaDB – Tabellen von MyISAM nach InnoDB konvertieren

Manchmal ist es notwendig Datenbank/Tabellen zu konvertieren. Kürzlich stand ich vor dem Problem eine Datenbank reparieren zu müssen.

Table 'tablename' is marked as crashed and should be repaired 

Hier die Queries, welche die notwendigen ALTER statements generieren.

InnoDB nach MyISAM


SELECT CONCAT('ALTER TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ' engine=MyISAM;') 
FROM information_schema.TABLES WHERE ENGINE = 'InnoDB';

MyISAM nach InnoDB

SELECT CONCAT('ALTER TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ' engine=InnoDB;') 
FROM information_schema.TABLES WHERE ENGINE = 'MyISAM';

Join the ConversationLeave a reply

Your email address will not be published. Required fields are marked *

Comment*

Name*

Website