Advertisement
Guest User

Untitled

a guest
May 6th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. ############################################
  3. # Make all table and columns charset UTF-8 #
  4. ############################################
  5.  
  6. # Replace parameters below before use
  7. database=[database]
  8. user=[user]
  9. password=[password]
  10.  
  11. mysql.exe --database=${database} -u ${user} -p${password} -B -N -e "SHOW TABLES" \
  12. | 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; "}' \
  13. | mysql.exe -u ${user} -p${password} --database=${database} &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement