I have been attempting to install MySQL 5.1.59 from source for the last couple of days on a Debian server. Every time I run the build process everything appears to go completely smooth(including make test). After completing post install steps I try running the client and get a segmentation fault as seen below. I understand that I could easily install this using apt, but I am determined to build MySQL from source at least once. Any ideas or helpful hints would be greatly appreciated. Thanks ahead of time!
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
Here is a complete list of the commands I ran in order.
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
I have tried starting the server with and without the –user flag and it doesn’t change the outcome. Also I have tried the command that it says “cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &” and it stays in the foreground and displays:
[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
After running that the log shows:
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
If you need anymore information please feel free to ask and thank you very much for your time!
-Josh
After taking the advice of Sjoerd I used gdb to run a backtrace and was able to find a bug report that matched my situation. http://bugs.mysql.com/bug.php?id=58497 is the link. Basically you have to modify the term.c file’s lines 904: comment it out and 914: set area equal to NULL.
Once you have made these changes you should be able to rebuild MySQL.
The file should be located at (MySQL Source Location)/cmd-line-utils/libedit/term.c
otherwise you can use a
find / -name "term.c"to find it.Hope this helps!
-Josh