Skip to content

Instantly share code, notes, and snippets.

@dkln
Created July 7, 2010 15:07
Show Gist options
  • Save dkln/466809 to your computer and use it in GitHub Desktop.
Save dkln/466809 to your computer and use it in GitHub Desktop.
Convert MySQL tables to utf8
mysql --database=db -B -N -e "SHOW TABLES" -u root | awk '{print "ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"}' | mysql --database=db -u root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment