问题现象如下
[root@localhost bin]# ./mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.6.24 Source distribution Copyright (c) 2000, 2015, 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
在源码包里,编辑文件 cmd-line-utils/libedit/terminal.c
把terminal_set方法中的 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; --phpfensi.com (void) sigemptyset(&nset); (void) sigaddset(&nset, SIGWINCH); (void) sigprocmask(SIG_BLOCK, &nset, &oset); area = NULL;然后重新编译即可
本文介绍了一种解决MySQL客户端在连接后出现Segmentation fault问题的方法。通过修改源码中的cmd-line-utils/libedit/terminal.c文件,注释掉特定行并将变量赋值为NULL,可以有效避免该故障发生。

7073

被折叠的 条评论
为什么被折叠?



