Created
May 19, 2023 14:18
-
-
Save mustafauysal/c8a196e8df4c8ac5d6993eaf38499264 to your computer and use it in GitHub Desktop.
Convert latin1_* to utf8_
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE wp_posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; | |
UPDATE wp_posts SET post_content = CONVERT(CAST(CONVERT(post_content USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_title = CONVERT(CAST(CONVERT(post_title USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_excerpt = CONVERT(CAST(CONVERT(post_excerpt USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_status = CONVERT(CAST(CONVERT(post_status USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET comment_status = CONVERT(CAST(CONVERT(comment_status USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET ping_status = CONVERT(CAST(CONVERT(ping_status USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_password = CONVERT(CAST(CONVERT(post_password USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_name = CONVERT(CAST(CONVERT(post_name USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET to_ping = CONVERT(CAST(CONVERT(to_ping USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET pinged = CONVERT(CAST(CONVERT(pinged USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_content_filtered = CONVERT(CAST(CONVERT(post_content_filtered USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET guid = CONVERT(CAST(CONVERT(guid USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_type = CONVERT(CAST(CONVERT(post_type USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_mime_type = CONVERT(CAST(CONVERT(post_mime_type USING latin1) AS BINARY) USING utf8); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Optional -
ALTER TABLE wp_posts ENGINE='InnoDB';