Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- ############################################
- # Make all table and columns charset UTF-8 #
- ############################################
- # Replace parameters below before use
- database=[database]
- user=[user]
- password=[password]
- mysql.exe --database=${database} -u ${user} -p${password} -B -N -e "SHOW TABLES" \
- | awk.exe '{print "SET foreign_key_checks = 0; ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; SET foreign_key_checks = 1; "}' \
- | mysql.exe -u ${user} -p${password} --database=${database} &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement