As follows:
Copy Code code as follows:
Warning at/admin/assets/add/
Incorrect string value: ' \xe5\x93\x88\xd5\x92\x88 ... ' for column ' Name ' at row 1
Request Method:post
Request url:http://127.0.0.1:8000/admin/assets/add/
Django version:1.2.3
Exception type:warning
Exception Value:
Incorrect string value: ' \xe5\x93\x88\xd5\x92\x88 ... ' for column ' Name ' at row 1
Exception Location:/usr/lib/pymodules/python2.7.1/mysqldb/cursors.py in _warning_check, line 82
Python executable:/usr/bin/python
Python version:2.7.1
The initial judgment should be the question of MySQL [The nature of the study]:
Add the following in My.ini:
Copy Code code as follows:
[Client]
Character-set-client = UTF8
Default-character-set = UTF8
[Mysqld]
Character-set-server = UTF8
Character-set-filesystem = Utf8[mysql]
init_connect= ' SET NAMES UTF8 '
[MySQL]
Default-character-set=utf8
Reboot the MySQL server and solve the problem.
To view the default encoding for creating a MySQL database:
Show CREATE Database db_name;
To change the encoding of the DB that has been created:
ALTER DATABASE db_name character set UTF8 collate utf8_general_ci;
To view database-related information:
Mysql>status
View database related Information 2:
Mysql> Show variables like ' char% ';