How to change mysql settings so that it defaults to UTF-8?

I get "ASCII encoding" errors when pasting into my database because I did a new installation of MYSQL.

I would like to change the default value again to UTF-8.

This is the error I get because MYSQL is not installed in UTF-8 mode:

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

You can try putting 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 

Additional Information:

+1
source

Source: https://habr.com/ru/post/1308692/


All Articles