mysql登陆数据库报错Segmentation fault (核心已转储)的解决办法
转自:https://bbs.cnbugs.com/read-43-1.html
今天在登陆新安装好的数据库报如下错误:
- [root@lnmp ~]# mysql -uroot -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 13
- Server version: 8.0.21
- Copyright (c) 2000, 2020, 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 (核心已转储)
原因好像是和C语言有关系
解决办法:
修改terminal.c文件重新编译安装
- [root@lnmp mysql-8.0.21]# find ./ -name terminal.c
- ./extra/libedit/libedit-20190324-3.1/src/terminal.c
查找出来之后按照以下方式修改
- [root@lnmp mysql-8.0.21]# vim /opt/mysql-8.0.21/extra/libedit/libedit-20190324-3.1/src/terminal.c
- 842 terminal_set(EditLine *el, const char *term)
- 843 {
- 844 int i;
- 845 /*char buf[TC_BUFSIZE];*/
- 846 char *area;
- 847 const struct termcapstr *t;
- 848 sigset_t oset, nset;
- 849 int lins, cols;
- 850
- 851 (void) sigemptyset(&nset);
- 852 (void) sigaddset(&nset, SIGWINCH);
- 853 (void) sigprocmask(SIG_BLOCK, &nset, &oset);
- 854
- 855 area = NULL;
修改完之后在重新编译安装就可以了
改行去放羊