Windows10下mysql5.5数据库命令行中文乱码解决方案

重置系统后,很久之前安装的mysql数据库出现了控制台查询中文乱码问题,本文主要和大家分享windows10mysql5.5数据库命令行中文乱码解决方案,希望能帮助到大家。

打开安装目录下的my.ini文件

我的是:C:Program FilesMySQLMySQL Server 5.5下面,修改如下:

[client]default-character-set=utf8port=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 onport=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 rootdatadir="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 definedcharacter-set-server=utf8collation-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 FilesMySQLMySQL Server 5.5sharecharsets |+--------------------------+---------------------------------------------------------+操作试试: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)

相关推荐:

详解mysql数据库中文乱码问题

文心快码 文心快码

文心快码(Comate)是百度推出的一款AI辅助编程工具

文心快码 35 查看详情 文心快码

MySQL插入数据时遇到中文乱码改怎么办?

php如何解决中文乱码问题?

以上就是Windows10下mysql5.5数据库命令行中文乱码解决方案的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/386357.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年11月6日 13:42:37
下一篇 2025年11月6日 13:43:42

相关推荐

发表回复

登录后才能评论
关注微信