我一直在尝试在Debian服务器上从源代码安装MySQL 5.1.59。每次运行构建过程时,一切看起来都非常顺利(包括make test)。完成安装后的步骤后,我尝试运行客户端并获得分段错误,如下所示。我知道我可以使用apt轻松安装它,但我决定至少从源代码构建MySQL一次。任何想法或有用的提示将不胜感激。提前谢谢!
debiantesting-01:/usr/local/mysql# bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.59-log Source distribution
Copyright (c) 2000, 2011, 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
以下是我按顺序运行的命令的完整列表。
groupadd mysql
useradd -g mysql mysql
tar -xvf mysql*
cd mysql*
ls
./configure --prefix=/usr/local/mysql --with-extra-charsets=all
make
make test
make install
cd /usr/local/mysql
ls
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
cp /usr/local/src/mysql*/support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/share/mysql/mysql.server start --user=mysql
/usr/local/mysql/bin/mysql_secure_installation
bin/mysql -u root -p
我尝试使用和不使用--user标志启动服务器,但它不会改变结果。我也尝试过命令“cd / usr / local / mysql; / usr / local / mysql / bin / mysqld_safe&”它保持在前景并显示:
[1] 31150
debiantesting-01:/usr/local/mysql# 111115 09:37:30 mysqld_safe Logging to '/usr/local/mysql/var/debiantesting-01.err'.
111115 09:37:30 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
运行后,日志显示:
111115 10:30:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
111115 10:30:42 [Note] Event Scheduler: Loaded 0 events
111115 10:30:42 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.1.59-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
如果您需要更多信息,请随时提出并非常感谢您的时间!
-Josh
答案 0 :(得分:3)
在接受Sjoerd的建议后,我使用gdb运行回溯,并且能够找到符合我情况的错误报告。 http://bugs.mysql.com/bug.php?id=58497是链接。基本上你必须修改term.c文件的第904行:注释掉它,914:设置区域等于NULL。
Example
904: //char buf[TC_BUFSIZE];
914: area = NULL;
完成这些更改后,您应该可以重建MySQL。
该文件应位于(MySQL Source Location)/cmd-line-utils/libedit/term.c
否则您可以使用find / -name "term.c"
来查找它。
希望这有帮助!
-Josh