- Django 3 Web Development Cookbook
- Aidas Bendoraitis Jake Kronika
- 109字
- 2025-04-04 13:15:07
Setting UTF-8 as the default encoding for the MySQL configuration
MySQL describes itself as the most popular open source database. In this recipe, we will tell you how to set UTF-8 as the default encoding for it. Note that if you don't set this encoding in the database configuration, you might get into a situation where LATIN1 is used by default with your UTF-8-encoded data. This will lead to database errors whenever symbols such as € are used. This recipe will also save you from the difficulties of converting the database data from LATIN1 to UTF-8, especially when you have some tables encoded in LATIN1 and others in UTF-8.