百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>服务器> 命令行登录mysql提示Segmentation fault解决办法
分享文章到:

命令行登录mysql提示Segmentation fault解决办法

发布时间:01/15 来源: 浏览: 关键词:
我们自己编译的mysql,在使用命令行登录时,提示该错误,经过查阅资料,解决方案如下在源代码目录中,编辑文件 cmd-line-utils/libedit/terminal.c2、terminal_set 方法中:a、注释 char buf[TC_BUFSIZE];b、把 area = buf; 改为 area = NULL;就可以了,具体的方法如下。


使用时报错如下

[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
mysql版本是5.6.24
服务器是CentOS7.0

==========解决方法1============

在源码包里,编辑文件 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;


然后重新编译即可

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有2人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板