Today in the Django program, the MARIADB as a database, but mariadb (a branch of MySQL, fully compatible with MySQL, now led by the founder of MySQL) does not support the default Chinese character set, so the online search answers did not find the right solution, It is mariadb can not use, had to unload load mariadb, encounter some trouble, with ubuntu-14.04.
Uninstall has three steps: 1. Delete Mysql-server:sudo apt-get autoremove--purge mysql-server-5.5;2. sudo apt-get remove mysql-common;3. It is important to clean up residual data: sudo dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs
Then reinstall MARIADB to sudo apt-get install Mariadb-server.
To solve the problem of Chinese character set
Open File: vim/etc/mysql/my.cnf
Add a row under [client] configuration:
Default-character-set=utf8
Add two lines under [Mysqld] (that is, the MySQL server configuration):
init_connect= ' SET NAMES UTF8 '
Character-set-server=utf8
and restart the MySQL service.
sudo service MySQL restart
This is a good way to use the Chinese language in Django applications, and it's an old problem to keep track of.