Skip to content

Instantly share code, notes, and snippets.

@kubaceg
Created May 5, 2014 13:31
Show Gist options
  • Save kubaceg/11536838 to your computer and use it in GitHub Desktop.
Save kubaceg/11536838 to your computer and use it in GitHub Desktop.
Convert all tables to utf8
mysql --user=username --password=your_pass --database=dbname -B -N -e "SHOW TABLES" | awk '{print "ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"}' | mysql --user=username --password=your_pass --database=dbname &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment