主頁(yè) > 知識(shí)庫(kù) > 解決Windows10下mysql5.5數(shù)據(jù)庫(kù)命令行中文亂碼問(wèn)題

解決Windows10下mysql5.5數(shù)據(jù)庫(kù)命令行中文亂碼問(wèn)題

熱門標(biāo)簽:網(wǎng)站排名優(yōu)化 Linux服務(wù)器 鐵路電話系統(tǒng) AI電銷 地方門戶網(wǎng)站 呼叫中心市場(chǎng)需求 百度競(jìng)價(jià)排名 服務(wù)外包

重置系統(tǒng)后,很久之前安裝的MySQL數(shù)據(jù)庫(kù)出現(xiàn)了控制臺(tái)查詢中文亂碼問(wèn)題,時(shí)間太久早已經(jīng)不記得怎么設(shè)置了。

網(wǎng)上查詢了許多,各種設(shè)置,重啟數(shù)據(jù)庫(kù)后仍然是中文亂碼。

可能是我搜索方式不對(duì),最后還好已經(jīng)解決,特開一處女博記錄一下:

打開安裝目錄下的my.ini文件

我的是:C:\Program Files\MySQL\MySQL Server 5.5下面,修改如下:

[client]
default-character-set=utf8
port=3306
[mysql]
#網(wǎng)上下面這個(gè) gbk 很多回答也是設(shè)置為utf8,結(jié)果就是亂碼
default-character-set=gbk
# SERVER SECTION
# ----------------------------------------------------------------------
## The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
[mysqld]# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.5/"
#Path to the database root
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8
collation-server=utf8_general_ci
修改完畢重啟mysql,查看一下編碼:
mysql> show variables like 'character_set%';
+--------------------------+---------------------------------------------------------+| 
Variable_name | Value |
+--------------------------+---------------------------------------------------------+|
 character_set_client | gbk || 
character_set_connection | gbk ||
 character_set_database | utf8 || 
character_set_filesystem | binary || 
character_set_results | gbk || 
character_set_server | utf8 ||
 character_set_system | utf8 ||
 character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\charsets\ |
+--------------------------+---------------------------------------------------------+
操作試試:
mysql> insert into per values('亂碼解決');
Query OK, 1 row affected (0.00 sec)
mysql> select * from per;
+--------------+| 
name |
+--------------+| 
的紛紛從 ||
 亂碼解決 |
+--------------+
3 rows in set (0.00 sec)

總結(jié)

以上所述是小編給大家介紹的 關(guān)于Windows10下解決MySQL5.5數(shù)據(jù)庫(kù)命令行中文亂碼問(wèn)題,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

您可能感興趣的文章:
  • PHP使用mysql_fetch_row查詢獲得數(shù)據(jù)行列表的方法
  • 5個(gè)MySQL GUI工具推薦,幫助你進(jìn)行數(shù)據(jù)庫(kù)管理
  • 簡(jiǎn)單了解操作mysql數(shù)據(jù)庫(kù)的命令行神器mycli
  • 為什么說(shuō)MySQL單表數(shù)據(jù)不要超過(guò)500萬(wàn)行
  • php使用mysqli和pdo擴(kuò)展,測(cè)試對(duì)比mysql數(shù)據(jù)庫(kù)的執(zhí)行效率完整示例
  • MySQL執(zhí)行update語(yǔ)句和原數(shù)據(jù)相同會(huì)再次執(zhí)行嗎
  • IDEA使用properties配置文件進(jìn)行mysql數(shù)據(jù)庫(kù)連接的教程圖解
  • mysql如何利用binlog進(jìn)行數(shù)據(jù)恢復(fù)詳解
  • MySQL數(shù)據(jù)庫(kù)Event定時(shí)執(zhí)行任務(wù)詳解
  • Java對(duì)MySQL數(shù)據(jù)庫(kù)進(jìn)行連接、查詢和修改操作方法
  • 詳解MySQL的數(shù)據(jù)行和行溢出機(jī)制

標(biāo)簽:黃山 湖南 銅川 崇左 衡水 仙桃 蘭州 湘潭

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《解決Windows10下mysql5.5數(shù)據(jù)庫(kù)命令行中文亂碼問(wèn)題》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266