mysql數(shù)據(jù)庫導(dǎo)出亂碼如何解決
mysql數(shù)據(jù)庫導(dǎo)出亂碼如何解決
首先在windows平臺下mysql用作導(dǎo)出數(shù)據(jù)庫源。查看字符編碼的系統(tǒng)變量:?
代碼如下:
mysql>?show?variables?like?‘%char%';? +————————–+—————————-+? |?variable_name?|?value?|? +————————–+—————————-+? |?character_set_client?|?latin1?|? |?character_set_connection?|?latin1?|? |?character_set_database?|?latin1?|? |?character_set_filesystem?|?binary?|? |?character_set_results?|?latin1?|? |?character_set_server?|?gbk?|? |?character_set_system?|?utf8?|? |?character_sets_dir?|?d:mysqlsharecharsets?|? +————————–+—————————-+
查看character_set_database,這里是latin1,latin1是裝不了多字節(jié)字符集的?
然后在windows下設(shè)置系統(tǒng)變量為utf8 :
mysql>set?character_set_database=utf8;?##設(shè)置默認的字符集為utf8
推薦:mysql教程
相關(guān)文章
- SQL 教程
- SQL INSERT 語句
- SQL UPDATE 語句
- SQL SELECT TOP, LIMIT, ROWNUM 子句
- SQL 通配符
- SQL IN 操作符
- SQL BETWEEN 操作符
- SQL 別名
- SQL LEFT JOIN 關(guān)鍵字
- SQL FULL OUTER JOIN 關(guān)鍵字
- SQL SELECT INTO 語句
- SQL CREATE DATABASE 語句
- SQL NOT NULL 約束
- SQL PRIMARY KEY 約束
- SQL FOREIGN KEY 約束
- SQL CREATE INDEX 語句
- SQL AUTO INCREMENT 字段
- SQL GROUP BY 語句
- SQL HAVING 子句
- SQL NULL 值