Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change a MySQL table to UTF-8?

I know there are many settings for a language for a table and a database.

I already created the database. I believe when I created it, it was default/LATIN. I want to change everything-I mean...both the table and the database, to UTF-8.

How can I do that? thanks.

like image 786
TIMEX Avatar asked May 25 '10 09:05

TIMEX


People also ask

How do I change the default charset of a MySQL table?

You can change the default with an alter table set default charset but that won't change the charset of the existing columns. To change that you need to use a alter table modify column . Changing the charset of a column only means that it will be able to store a wider range of characters.

How do I change utf8mb4 to UTF-8?

To solve the problem open the exported SQL file, search and replace the utf8mb4 with utf8 , after that search and replace the utf8mb4_unicode_520_ci with utf8_general_ci . Save the file and import it into your database. After that, change the wp-config. php charset option to utf8 , and the magic starts.


1 Answers

ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8; 
like image 191
Developer-Sid Avatar answered Sep 18 '22 21:09

Developer-Sid