{"id":68,"date":"2020-02-02T18:28:09","date_gmt":"2020-02-02T18:28:09","guid":{"rendered":"http:\/\/ictbank.ir\/blog\/?p=68"},"modified":"2020-03-26T00:52:25","modified_gmt":"2020-03-26T00:52:25","slug":"change-the-character-set-collation-of-a-table","status":"publish","type":"post","link":"https:\/\/ictbank.ir\/blog\/change-the-character-set-collation-of-a-table\/","title":{"rendered":"Change the Character Set &#038; Collation of a table"},"content":{"rendered":"\n<p>To change the Character Set and Collation of a field of a table you have to use this query: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nALTER TABLE table_name MODIFY column_name data_type CHARACTER SET UTF8 COLLATE UTF8_UNICODE_CI;\n<\/pre><\/div>\n\n\n<p>if the table contains data, you have to update that data as follow: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nUPDATE table_name SET column_name= CONVERT(CAST(CONVERT(column_name USING LATIN1) AS BINARY) USING UTF8)\n<\/pre><\/div>  ","protected":false},"excerpt":{"rendered":"<p>To change the Character Set and Collation of a field of a table you have to use this query: if the table contains data, you have to update that data as follow:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"footnotes":""},"categories":[8,34],"tags":[38,18,37,6,36,35],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-database","category-mysql","tag-alter","tag-characterset","tag-collation","tag-database","tag-mariadb","tag-mysql"],"_links":{"self":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":4,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":138,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions\/138"}],"wp:attachment":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}