您好,登錄后才能下訂單哦!
這篇文章主要介紹Windows10下mysql5.5數據庫命令行中文亂碼怎么辦,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
打開安裝目錄下的my.ini文件
我的是:C:\Program Files\MySQL\MySQL Server 5.5下面,修改如下:
[client] default-character-set=utf8 port=3306 [mysql] #網上下面這個 gbk 很多回答也是設置為utf8,結果就是亂碼 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)
以上是Windows10下mysql5.5數據庫命令行中文亂碼怎么辦的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。