Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 views
in Technique[技术] by (71.8m points)

utf 8 - How to check if MySQL table is UTF-8 and has storageEngine InnoDB?

Googling around just finds instructions for changing from one format to another, but I can't seem to find how exactly to make sure which of these I have first.

How can I:

  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?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use information_schema in order to know the engine of each table.

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

For the encoding you can use

show create table table_name

or, even better

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";

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...