{"id":7661,"date":"2018-07-05T09:46:02","date_gmt":"2018-07-05T01:46:02","guid":{"rendered":"http:\/\/rmohan.com\/?p=7661"},"modified":"2018-07-05T09:46:02","modified_gmt":"2018-07-05T01:46:02","slug":"mysql-dump-issue-utf8_unicode_520_ci","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7661","title":{"rendered":"mysql dump issue utf8_unicode_520_ci"},"content":{"rendered":"<div class=\"votecell post-layout--left\">\n<div class=\"vote\"><\/div>\n<\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"post-text\">\n<p>i use this in linux :<\/p>\n<pre class=\"lang-sql prettyprint prettyprinted\"><code><span class=\"pln\">sed <\/span><span class=\"pun\">-<\/span><span class=\"pln\">i <\/span><span class=\"str\">'s\/utf8mb4\/utf8\/g'<\/span><span class=\"pln\"> your_file<\/span><span class=\"pun\">.<\/span><span class=\"pln\">sql\r\nsed <\/span><span class=\"pun\">-<\/span><span class=\"pln\">i <\/span><span class=\"str\">'s\/utf8_unicode_ci\/utf8_general_ci\/g'<\/span><span class=\"pln\"> your_file<\/span><span class=\"pun\">.<\/span><span class=\"pln\">sql\r\nsed <\/span><span class=\"pun\">-<\/span><span class=\"pln\">i <\/span><span class=\"str\">'s\/utf8_unicode_520_ci\/utf8_general_ci\/g'<\/span><span class=\"pln\"> your_file<\/span><span class=\"pun\">.<\/span><span class=\"pln\">sql<\/span><\/code><\/pre>\n<p>then restore your_file.sql<\/p>\n<pre class=\"lang-sql prettyprint prettyprinted\"><code><span class=\"pln\">mysql <\/span><span class=\"pun\">-<\/span><span class=\"pln\">uyourdbuser <\/span><span class=\"pun\">-<\/span><span class=\"pln\">pyourdbpasswd yourdb <\/span><span class=\"pun\">&lt;<\/span><span class=\"pln\"> your_file<\/span><span class=\"pun\">.<\/span><span class=\"pln\">sql<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\n<p>i use this in linux :<\/p>\n<p> sed -i &#8216;s\/utf8mb4\/utf8\/g&#8217; your_file.sql sed -i &#8216;s\/utf8_unicode_ci\/utf8_general_ci\/g&#8217; your_file.sql sed -i &#8216;s\/utf8_unicode_520_ci\/utf8_general_ci\/g&#8217; your_file.sql <\/p>\n<p>then restore your_file.sql<\/p>\n<p> mysql -uyourdbuser -pyourdbpasswd yourdb &lt; your_file.sql [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7661"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7661"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7661\/revisions"}],"predecessor-version":[{"id":7662,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7661\/revisions\/7662"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}