錯誤提示
就是中文全部顯示亂碼了
解決方式
查詢mysql設置
mysql> s
--------------
c:Program FilesMySQLMySQL Server 5.0binmysql.exe Ver 14.12 Distrib 5.0.67,
for Win32 (ia32)
Connection id: 1
Current database: common
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 1 min 23 sec
Threads: 1 Questions: 14 Slow queries: 0 Opens: 13 Flush tables: 1 Open tab
les: 7 Queries per second avg: 0.169
在導出mysql sql執行文件的時候,指定一下編碼格式:
mysqldump -uroot -p --default-character-set=utf8 mo(dbname) > E://xxxx.sql
導入的時候OK了
執行如下
代碼如下 復制代碼
mysql -u root -p --default-character-set=utf8
use dbname
source /root/newsdata.sql
注意:如果你是gbk我們只要設置成gbk就可以了,要看上面查出來你數據庫編碼了哦。