Is there a SQL or PHP script that I can run that will change the default collation in all tables and fields in a database?
I can write one
In addition to @davidwinterbottom answer, windows users can use command below:
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] &
Replace [database], [user] and [password] placeholders with actual values.
Git-bash users can download this bash script and run it easily.