- Access the server through SSH and the root user or a user with MySQL administrative privileges.
- Run the following line, substituting the "dbname" values for the database itself. This will change the encoding of each table to utf8:
mysql --database=dbname -B -N -e "SHOW TABLES" | awk '{print "SET foreign_key_checks = 0; ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; SET foreign_key_checks = 1;"}'}' | mysql --database=dbname.
- After that, we access MySQL using:
mysql
- Once inside, to change the database encoding, we execute the following, changing "dbname" for the database in question:
ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
Si todavía tienes dudas, contacta con nosotros y te ayudamos.