How do I see what character set a MySQL database / table / column is?

前端 未结 15 1456
失恋的感觉
失恋的感觉 2020-11-22 06:33

What is the (default) charset for:

  • MySQL database

  • MySQL table

  • MySQL column

15条回答
  •  逝去的感伤
    2020-11-22 07:02

    As many wrote earlier, SHOW FULL COLUMNS should be the preferred method to get column information. What's missing is a way to get charset after that without reaching metadata tables directly:

    SHOW FULL COLUMNS FROM my_table WHERE Field = 'my_field'
    SHOW COLLATION WHERE Collation = 'collation_you_got'
    

提交回复
热议问题