Skip to content

Instantly share code, notes, and snippets.

@Somrlik
Created November 3, 2017 01:29
A sql query that will create sql commands to convert all tables and columns from database to utf8mb4 so you can have emojis in text you sicko
SELECT CONCAT(
'ALTER TABLE ',TABLE_SCHEMA,'.',TABLE_NAME,
' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'
)
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'databasename';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment