这篇文章主要讲解了“MySQL binlog日志乱码的处理方法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“MySQL binlog日志乱码的处理方法”吧!
OS:Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@mysql1 log]# echo $LANG
en_US.UTF-8
接着在网上查资料发现有人说
当mysql服务器版本是5.6时,一定切记要使用版本>=3.4的mysqlbinlog,否则会出现乱码问题。
查了我的mysqlbinlog版本:
[root@mysql1 log]# mysqlbinlog --version
mysqlbinlog Ver 3.3 for redhat-linux-gnu at x86_64
发现版本确实低于3.4 。
那这个怎么单独升级呢???难道MySQL 5.6.30自带的版本自己不能用???
使用绝对路径再查询一次版本:
[root@mysql1 log]# /mysql/bin/mysqlbinlog --version
/mysql/bin/mysqlbinlog Ver 3.4 for Linux at x86_64
坑爹啊!!!!绝对路径是对的。
使用绝对路径的方式查看日志,乱码消失。
MySQL binlog日志乱码的处理方法
解决相对路径问题。
检查环境变量.bash_profile的设置。
[root@mysql1 ~]# vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/mysql/bin
export PATH
加环境变量的时候把/mysql/bin加在的最后面,系统读变量从前到后的顺序。
大型站长资讯类网站! https://www.0818zz.com