A script to change all tables and fields to the utf-8-bin collation in MYSQL

后端 未结 16 1043
有刺的猬
有刺的猬 2020-12-04 06:24

Is there a SQL or PHP script that I can run that will change the default collation in all tables and fields in a database?

I can write one

16条回答
  •  孤街浪徒
    2020-12-04 06:52

    In scripts above all tables selected for convertation (with SHOW TABLES), but a more convenient and portable way to check the table collation before converting a table. This query does it:

    SELECT table_name
         , table_collation 
    FROM information_schema.tables
    

提交回复
热议问题