Skip to content

Instantly share code, notes, and snippets.

@flabernardez
Forked from carlalexander/update_db_utf8mb4.php
Last active May 12, 2021 20:37
Show Gist options
  • Save flabernardez/229a9e3379544be55e064693066ffcdc to your computer and use it in GitHub Desktop.
Save flabernardez/229a9e3379544be55e064693066ffcdc to your computer and use it in GitHub Desktop.
#wordpress #database change charset to utf8mb4
SELECT CONCAT("ALTER TABLE ", TABLE_SCHEMA, '.', TABLE_NAME,' COLLATE utf8mb4_general_ci;')
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='local' AND TABLE_TYPE = 'BASE TABLE';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment