温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Ubuntu mysql编译乱码的解决方法

发布时间:2021-09-16 11:27:26 来源:亿速云 阅读:133 作者:chen 栏目:系统运维

这篇文章主要讲解了“Ubuntu mysql编译乱码的解决方法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Ubuntu mysql编译乱码的解决方法”吧!

我的解决方法是,在/etc/my.cnf文件中加上以下两行内容:
[client]default-character-set=utf8[mysqld]default-character-set=utf8
注意,这个文件不一定存在,需将 /安装原文件/support-files/my-medium.cnf 复制到/etc/下,重命名
需重启Ubuntu mysql
停用:sudo /usr/local/mysql/bin/mysqladmin shutdown
启用sudo /usr/local/mysql/bin/mysqld_safe -user=mysql &

查看Ubuntu mysql编码

启用后sudo /usr/local/mysql/bin/mysql
mysql>show variables like 'character%';
Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/

注意,Ubuntu mysql这样改变后原先所建数据库似乎不能用(不确定),尽量备份新建数据库,就不会有乱码了。
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('https://cache.yisu.com/upload/information/20210521/367/443009.gif');}" onmousewheel="return imgzoom(this);" alt="" />

感谢各位的阅读,以上就是“Ubuntu mysql编译乱码的解决方法”的内容了,经过本文的学习后,相信大家对Ubuntu mysql编译乱码的解决方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI