小編碰到在linux中安裝MySQL 5.6.16登錄出錯:段錯誤(Segmentation fault)了,那么碰到此問題要怎么解決呢?下面我們一起來看看吧.
Centos 6.5 安裝 MySQL 5.6.16 后,使用命令登錄出錯:
- [root@test mysql-5.6.16]# mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 1
- Server version: 5.6.16-log Source distribution
- --Vevb.com
- Copyright (c) 2000, 2014, 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”,查找過許多方法都不能成功,最后終于在國外網站上看到關于這個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;
更正后的代碼類似:
- 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;
- --Vevb.com
- (void) sigemptyset(&nset);
- (void) sigaddset(&nset, SIGWINCH);
- (void) sigprocmask(SIG_BLOCK, &nset, &oset);
- area = NULL;
保存后,重新編譯MySQL,就可以在命令行中正常登錄了.
新聞熱點
疑難解答