当前位置:首页 > Mysql教程 > 列表

安装MySQL 5.6.16登录出错:段错误 (Segmentation fault)解决办法

发布:smiling 来源: PHP粉丝网  添加日期:2015-04-17 17:30:50 浏览: 评论:0 

小编碰到在linux中安装MySQL 5.6.16登录出错:段错误(Segmentation fault)了,那么碰到此问题要怎么解决呢?下面我们一起来看看吧.

Centos 6.5 安装 MySQL 5.6.16 后,使用命令登录出错:

  1. [root@test mysql-5.6.16]# mysql -u root -p 
  2. Enter password:  
  3. Welcome to the MySQL monitor.  Commands end with ; or \g. 
  4. Your MySQL connection id is 1 
  5. Server version: 5.6.16-log Source distribution 
  6. --phpfensi.com 
  7. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 
  8. Oracle is a registered trademark of Oracle Corporation and/or its 
  9. affiliates. Other names may be trademarks of their respective 
  10. 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;

更正后的代码类似:

  1. protected int 
  2. terminal_set(EditLine *el, const char *term) 
  3. int i; 
  4. /*char buf[TC_BUFSIZE];*/ 
  5. char *area; 
  6. const struct termcapstr *t; 
  7. sigset_t oset, nset; 
  8. int lins, cols; 
  9. --phpfensi.com 
  10. (void) sigemptyset(&nset); 
  11. (void) sigaddset(&nset, SIGWINCH); 
  12. (void) sigprocmask(SIG_BLOCK, &nset, &oset); 
  13.  
  14. area = NULL

保存后,重新编译MySQL,就可以在命令行中正常登录了.

Tags: mysql段错误 Segmentation

分享到: