小编碰到在linux中安装MySQL 5.6.16登录出错:段错误(Segmentation fault)了,那么碰到此问题要怎么解决呢?下面我们一起来看看吧.
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
- --Vevb.com
- 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;
更正后的代码类似:
- protected int
- terminal_set(EditLine *el, const char *term)
- {
- int i;
- /*char buf[TC_BUFSIZE];*/
- char *area;
- const struct termcapstr *t;
- sigset_t oset, nset;
- int lins, cols;
- --Vevb.com
- (void) sigemptyset(&nset);
- (void) sigaddset(&nset, SIGWINCH);
- (void) sigprocmask(SIG_BLOCK, &nset, &oset);
- area = NULL;
保存后,重新编译MySQL,就可以在命令行中正常登录了.
新闻热点
疑难解答