Как проверить, является ли таблица MySQL UTF-8 и имеет storageEngine InnoDB?

Поиск в Google только содержит инструкции для перехода от одного формата к другому, но я не могу найти, как точно убедиться, какие из них у меня есть.

Как я могу:

1) Check what character encoding a table has?
2) Check what storage engine a table uses?
3) Check if all tables are certain encoding?
4) Check if all tables have a certain storage engine?

Спасибо!!

Ответы

Ответ 1

Вы можете использовать information_schema, чтобы знать двигатель каждой таблицы.

select table_name,engine 
from information_schema.tables
where table_schema = 'your_database'

Для кодировки вы можете использовать

show create table table_name

или, даже лучше

select 
c.character_set_name 
from information_schema.tables as t,
     information_schema.collation_character_set_applicability as c
where c.collation_name = t.table_collation
and t.table_schema = "your_db"
and t.table_name = "table_name";