mysql登陆数据库报错Segmentation fault (核心已转储)的解决办法

发布时间 2023-08-21 16:20:41作者: 来自牧羊人

 

转自:https://bbs.cnbugs.com/read-43-1.html

今天在登陆新安装好的数据库报如下错误:

 

  1. [root@lnmp ~]# mysql -uroot -p
  2. Enter password:
  3. Welcome to the MySQL monitor. Commands end with ; or \g.
  4. Your MySQL connection id is 13
  5. Server version: 8.0.21
  6.  
  7. Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
  8.  
  9. Oracle is a registered trademark of Oracle Corporation and/or its
  10. affiliates. Other names may be trademarks of their respective
  11. owners.
  12.  
  13. Segmentation fault (核心已转储)

原因好像是和C语言有关系

 

解决办法:

修改terminal.c文件重新编译安装

 

  1. [root@lnmp mysql-8.0.21]# find ./ -name terminal.c
  2. ./extra/libedit/libedit-20190324-3.1/src/terminal.c
  3.  

查找出来之后按照以下方式修改

 

 

  1. [root@lnmp mysql-8.0.21]# vim /opt/mysql-8.0.21/extra/libedit/libedit-20190324-3.1/src/terminal.c
  2. 842 terminal_set(EditLine *el, const char *term)
  3. 843 {
  4. 844 int i;
  5. 845 /*char buf[TC_BUFSIZE];*/
  6. 846 char *area;
  7. 847 const struct termcapstr *t;
  8. 848 sigset_t oset, nset;
  9. 849 int lins, cols;
  10. 850
  11. 851 (void) sigemptyset(&nset);
  12. 852 (void) sigaddset(&nset, SIGWINCH);
  13. 853 (void) sigprocmask(SIG_BLOCK, &nset, &oset);
  14. 854
  15. 855 area = NULL;

Image

 

 

修改完之后在重新编译安装就可以了