{"id":504,"date":"2024-09-09T10:21:57","date_gmt":"2024-09-09T10:21:57","guid":{"rendered":"http:\/\/basicwebsitesolutions.com\/blog\/?p=504"},"modified":"2024-09-09T10:21:58","modified_gmt":"2024-09-09T10:21:58","slug":"storing-chinese-characters-in-mysql-chinese-characters-not-working-in-mysql","status":"publish","type":"post","link":"https:\/\/basicwebsitesolutions.com\/blog\/2024\/09\/09\/storing-chinese-characters-in-mysql-chinese-characters-not-working-in-mysql\/","title":{"rendered":"Storing Chinese Characters in Mysql \/ Chinese Characters Not Working in MySQL"},"content":{"rendered":"\n<p>Recently transferring to another website, the chinese characters are not working already. <\/p>\n\n\n\n<p>Googling the answer led me to this code, you can convert existing columns one by one, or else you can convert them all at once this way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; ALTER TABLE nameTable CONVERT TO CHARACTER SET utf8mb4, COLLATE utf8mb4_bin;\n\nmysql&gt; SHOW CREATE TABLE nameTable\\G\n\nCREATE TABLE `nameTable` (\n  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n  `version` bigint(20) DEFAULT NULL,\n  `country` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,\n  `englishName` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,\n  `chinesename` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin <\/code><\/pre>\n\n\n\n<p>After running the code made it ok<\/p>\n\n\n\n<p>Thank you for the web<\/p>\n\n\n\n<p>Coffee Cup<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Storing Chinese Characters in mysql<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,11],"tags":[324,323,254,326,325],"class_list":["post-504","post","type-post","status-publish","format-standard","hentry","category-day-to-day-life","category-php-and-mysql","tag-characters","tag-chinese","tag-mysql","tag-not-converting","tag-not-showing"],"_links":{"self":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=504"}],"version-history":[{"count":1,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/504\/revisions"}],"predecessor-version":[{"id":505,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/504\/revisions\/505"}],"wp:attachment":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}