I can’t change my column collate in mysql to utf8_general_ci

Asked

Viewed 318 times

0

Good morning Personal.

I have a problem with changing the collate of a column in my database. An example of how I am running:

ALTER TABLE `minhaTabela` CHANGE COLUMN `nome` `nome` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_general_ci' AFTER `id`;

Whenever I run, it does not change and leaves the null field. It only allows me to leave with the utf8_unicode format. This is making me nervous a little and I can’t find a solution. The table is Myisam, it’s not like Innodb.. I don’t know if this is related.

Any idea how to help me?

1 answer

1

This example worked for me:

ALTER TABLE `minhaTabela` CHANGE `nome` `nome` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;

NOTE: there is no difference in the query to change the COLLATE between the Myisam engine and Innodb

  • I solved it. I realized I would have to change all fields to the default database and convert all. I ran the code and it worked. But it only worked due to conversion.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.