??????????????Django?????????MySQL????????????????????????????±??????
????/usr/local/lib/python2.7/dist-packages/Django-1.11.dev20170117002028-py2.7.egg/django/db/backends/mysql/base.py:109: Warning: Incorrect string value: 'xE6x88x90xE5x8Ax9F...' for column 'json' at row 1
????return self.cursor.execute(query?? args)
????[07/Feb/2017 12:15:21] "GET /index/ HTTP/1.1" 200 250
???????????????MySQL???????????
??????????????
????mysql> show create database bangjob;
????+----------+--------------------------------------------------------------------+
????| Database | Create Database                                                    |
????+----------+--------------------------------------------------------------------+
????| bangjob  | CREATE DATABASE `bangjob` /*!40100 DEFAULT CHARACTER SET latin1 */ |
????+----------+--------------------------------------------------------------------+
????1 row in set (0.00 sec)
????mysql> show variables like'%char%';
????+--------------------------+----------------------------+
????| Variable_name            | Value                      |
????+--------------------------+----------------------------+
????| character_set_client     | utf8                       |
????| character_set_connection | utf8                       |
????| character_set_database   | latin1                     |
????| character_set_filesystem | binary                     |
????| character_set_results    | utf8                       |
????| character_set_server     | latin1                     |
????| character_set_system     | utf8                       |
????| character_sets_dir       | /usr/share/mysql/charsets/ |
????+--------------------------+----------------------------+
????8 rows in set (0.00 sec)
???????????????
????mysql> set character_set_database=utf8;
????Query OK?? 0 rows affected (0.00 sec)
????mysql> set character_set_server=utf8;
????Query OK?? 0 rows affected (0.00 sec)
?????????????
????mysql> show variables like'%char%';
????+--------------------------+----------------------------+
????| Variable_name            | Value                      |
????+--------------------------+----------------------------+
????| character_set_client     | utf8                       |
????| character_set_connection | utf8                       |
????| character_set_database   | utf8                       |
????| character_set_filesystem | binary                     |
????| character_set_results    | utf8                       |
????| character_set_server     | utf8                       |
????| character_set_system     | utf8                       |
????| character_sets_dir       | /usr/share/mysql/charsets/ |
????+--------------------------+----------------------------+
????8 rows in set (0.00 sec)
????????????????????κ????????
?????????????????????????????????????????????MySQL????????Ч??????
???????????????????
????sudo gedit /etc/mysql/my.cnf
??????my.cnf?????????????????????
????[client]
????default-character-set=utf8
????[mysqld]
????default-character-set=utf8
????[mysql]
????default-character-set=utf8
???????????MySQL??
????/etc/init.d/mysql start
??????????????????β?????????
????mysql> show variables like "%char%";
????+--------------------------+----------------------------+
????| Variable_name            | Value                      |
????+--------------------------+----------------------------+
????| character_set_client     | utf8                       |
????| character_set_connection | utf8                       |
????| character_set_database   | utf8                       |
????| character_set_filesystem | binary                     |
????| character_set_results    | utf8                       |
????| character_set_server     | utf8                       |
????| character_set_system     | utf8                       |
????| character_sets_dir       | /usr/share/mysql/charsets/ |
????+--------------------------+----------------------------+
????8 rows in set (0.01 sec)
???????????????????????????????????????????????
??????????MySQL??????????????????????PS???2?????????????????????????mysql -u root -p????????ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)??
???????????????±???????????????->->->->->!!!
????????????????????????????????????????????????
????sudo /etc/init.d/mysql status
??????mysql??????mysql respawn/post-start?? (post-start) process 55665
??????Щ??????????????????????????…
?????????????? /var/log/mysql/error.log

??????????ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)????????
????????
????[ mysqld ] ?μ? default-character-set=utf8’ ???
????character_set_server=utf8
????????????????????MySQL??????????????????????????Ч????????????????????????′???T_T????