Centos 6.5 安装 MySQL 5.6.16 后,使用命令登录出错:
[root@test mysql-5.6.16]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.16-log Source distribution
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
段错误
中文系统上会出现“段错误”,英文版则是“Segmentation fault”,查找过许多方法都不能成功,最后终于在国外网站上看到关于这个bug的解决方法:https://bugs.launchpad.net/percona-server/+bug/1201123,按照上面的介绍,解决问题步骤如下:
1. 在MySQL 5.6.16 源码包里,编辑文件 cmd-line-utils/libedit/terminal.c
2. 找到代码段类似 char buf[TC_BUFSIZE]; 的,将其注释,并找到下面的变量 area = buf; ,将其更改为 area = NULL;
更正后的代码类似:
865 protected int
866 terminal_set(EditLine *el, const char *term)
867 {
868 int i;
869 /*char buf[TC_BUFSIZE];*/
870 char *area;
871 const struct termcapstr *t;
872 sigset_t oset, nset;
873 int lins, cols;
874
875 (void) sigemptyset(&nset);
876 (void) sigaddset(&nset, SIGWINCH);
877 (void) sigprocmask(SIG_BLOCK, &nset, &oset);
878
879 area = NULL;
保存后,重新编译MySQL,就可以在命令行中正常登录了