從新restore了mysql到另外一台機械上後mysql 編碼成績報錯。本站提示廣大學習愛好者:(從新restore了mysql到另外一台機械上後mysql 編碼成績報錯)文章只能為提供參考,不一定能成為您想要的結果。以下是從新restore了mysql到另外一台機械上後mysql 編碼成績報錯正文
以下:
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
初步斷定 應當是mysql的成績 [代研討實質成績]:
在my.ini 添加以下:
[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
重啟mysql辦事器,成績處理。
檢查創立mysql數據庫的默許編碼:
show create database db_name;
更改曾經創立的db的編碼:
alter database db_name character set utf8 collate utf8_general_ci;
檢查數據庫相干信息:
mysql>status
檢查數據庫相干信息2:
mysql> show variables like 'char%';