Tuesday, June 28, 2016

Mysql / MariaDB check tables engine


SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'dbname' AND engine = 'MyISAM';


Where dbname - database name
And InnoDB - engine, you can use InnoDB


Convert MyISAM tables to InnoDB

SELECT CONCAT('ALTER TABLE ', TABLE_SCHEMA, '.', TABLE_NAME,' ENGINE=InnoDB;')
FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'DBNAME' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE'

Then run result as SQL query

For example:

 ALTER TABLE databasename.tablename ENGINE=InnoDB;

No comments:

Post a Comment

grub2-install: error: disk `mduuid/e54081d398c6d57b4d67436f6d032162' not found

After raid 1 disk replacement faced with this issue # grub2-install /dev/sdb Installing for i386-pc platform. grub2-install: error: disk `md...