MySQL數(shù)據(jù)庫亂碼問題
- 記錄一下:前幾天,在做一個ssm項目,然后出現(xiàn)了數(shù)據(jù)亂碼,找了很久,才發(fā)現(xiàn)錯誤,只需要簡單的改動就可以啦
改動方法
- mysql連接數(shù)據(jù)庫,后面加上即可
useUnicode=true&characterEncoding=UTF-8
- 形如:
jdbc:mysql://localhost:3306/house?useUnicode=true&characterEncoding=UTF-8