How to change the connection collation of Mysql

后端 未结 2 489
北荒
北荒 2021-02-13 04:13

How can I change connection collation of mysql database?

I am using Mysql workbench 5.5 and mysql 5.5 in ubuntu 14.

When I execute a stored procedure, an error o

2条回答
  •  渐次进展
    2021-02-13 05:03

    Firstly, I think the error message is because of the collation of stored procedure (connection) doesn't match the table. But I was wrong, the reason for the error is because of the collation of the column doesn't match the collation of the table.

    I want to change to collation of column to 'utf8_unicode_ci' in my case. So I have run this statement:

    alter table  
        MODIFY  VARCHAR(XXX) COLLATE 'utf8_unicode_ci';
    

    Please be aware that change of collation may result in data loss. For me, General -> Unicode, with all English in varchar column. There is none.

    Further reading: http://dev.mysql.com/doc/refman/5.7/en/charset-column.html

    http://dev.mysql.com/doc/refman/5.7/en/charset-connection.html

    http://dev.mysql.com/doc/refman/5.7/en/charset-database.html

提交回复
热议问题