I recently realized that I made a big mistake and encoded things on the front end in UTF-8 and on the DB side to latin1.
I am thinking to switch my MySQL db to UTF-8. Is there a “good practice” of doing such a procedure? Any recommended steps I can take? What are the pitfalls I should watch out for?
Thank you,
Alex
The major (and most common) pitfall would be hoping that
ALTER DATABASE … DEFAULT CHARACTER SETorALTER TABLE … DEFAULT CHARACTER SETwill change the encoding of the existing columns.These statements only affect the tables and columns created after you issued these statements.
You should
ALTEReach table separately, using