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
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;
更正後的代碼類似:
865 protected int
866 terminal_set(EditLine *el, const char *term)
867 {
868 int i;
869 /*char buf[TC_BUFSIZE];*/
870 char *area;
871 const struct termcapstr *t;
872 sigset_t oset, nset;
873 int lins, cols;
874
875 (void) sigemptyset(&nset);
876 (void) sigaddset(&nset, SIGWINCH);
877 (void) sigprocmask(SIG_BLOCK, &nset, &oset);
878
879 area = NULL;
儲存後,重新編譯MySQL,就可以在命令列中正常登入了