{"id":133,"date":"2014-10-22T08:22:59","date_gmt":"2014-10-22T08:22:59","guid":{"rendered":"http:\/\/angelwings.net\/blog\/?p=133"},"modified":"2014-10-22T08:22:59","modified_gmt":"2014-10-22T08:22:59","slug":"mysql-change-character-encoding-for-database-and-tables","status":"publish","type":"post","link":"https:\/\/angelwings.net\/blog\/mysql-change-character-encoding-for-database-and-tables\/","title":{"rendered":"mysql: Change character encoding for database and tables"},"content":{"rendered":"<p>http:\/\/stackoverflow.com\/questions\/6115612\/how-to-convert-an-entire-mysql-database-characterset-and-collation-to-utf-8<\/p>\n<p>Use the ALTER DATABASE and ALTER TABLE commands.<\/p>\n<p>ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;<br \/>\nALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;<\/p>\n<p>If not possible,<br \/>\nExport structure and data with phpmyadmin<br \/>\nCustom &#8211; display all possible options<br \/>\nDatabase system or older MySQL server to maximize output compatibility with: MYSQL40<br \/>\nSyntax to use when inserting data: include column names in every INSERT statement (Example: INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3))<br \/>\nAfter export, remove all TYPE=InnoDB from the text file (.sql)<br \/>\nCreate new database in utf8_unicode_ci;<br \/>\nImport the .sql file and tables created will inherit utf8_unicode_ci.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/stackoverflow.com\/questions\/6115612\/how-to-convert-an-entire-mysql-database-characterset-and-collation-to-utf-8 Use the ALTER DATABASE and ALTER TABLE commands. ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci; ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; If not possible, Export structure and data with phpmyadmin Custom &#8211; display all possible options Database system or older MySQL server to maximize output compatibility with: MYSQL40 Syntax [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[89,98],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-database","tag-mysql","tag-phpmyadmin"],"_links":{"self":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":0,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}