views:

41

answers:

1

I am getting "ASCII encoding" errors when I insert into my database because I did a fresh install of the MYSQL.

I'd like to change the default to UTF-8 again.

This is the error I'm getting because MYSQL is not set in UTF-8 mode:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
+1  A: 

You can try to put this in your mysql.cfg file:

[mysqld]  
port = 3306 
socket = mysql 
skip-locking 
init_connect='SET collation_connection = utf8_general_ci' 
init_connect='SET NAMES utf8' 
default-character-set=utf8 
character-set-server = utf8 
collation-server = utf8_general_ci 
[mysql] 
default-character-set=utf8 

More information:

Cristian