P
P
Peter2016-01-24 12:19:51
PHP
Peter, 2016-01-24 12:19:51

How to correctly change the database encoding?

There are 10,000 news items in the database, cp-1251 encoding. Is it possible and how to change it to utf-8 correctly? Or just replace the encoding in the tables with the required one? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dim Boy, 2016-01-24
@twix007

ALTER DATABASE base CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question