Skip to content

Instantly share code, notes, and snippets.

@erkineren
Last active June 18, 2019 15:08
Show Gist options
  • Save erkineren/a6f5fd460ada007be6c7736992844fda to your computer and use it in GitHub Desktop.
Save erkineren/a6f5fd460ada007be6c7736992844fda to your computer and use it in GitHub Desktop.
Change db tables and columns charset quickly - Veritabanı tablo ve kolonlar karakter setini hızlı değiştir
SELECT CONCAT('ALTER TABLE ',TABLE_SCHEMA,'.',TABLE_NAME,' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;')
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'db_name';
# Example Output - Örnek Çıktı:
# ALTER TABLE db_name.table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment