mysql解決[HY000][1366] Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'title' at row 1

最近在玩django ORM操作,本地部署mysql之後,往庫裏插入中文時,總是報錯,如圖所示: 查找原因是因爲插入的字符格式不正確,通過命令 show variables like "%character%";可以查看格式爲: 需要改成我們utf8格式纔可以插入中文,臨時修改了一個表格式,通過命令: alter table `tablename` convert to character set
相關文章
相關標籤/搜索