After emerging MySQL 4.1.7, 4.1.8 or 4.1.9 I get the following error when trying to run the perl script to instalize the DB: #mysql_install_db Installing all prepared tables /usr/bin/mysql_create_system_tables: line 664: 13756 Broken pipe cat <<END_OF_DATA use mysql; $c_d $i_d $c_h $i_h $c_u $i_u $c_f $i_f $c_t $c_c $c_ht $c_hc $c_hr $c_hk $c_tzn $i_tzn $c_tz $i_tz $c_tzt $i_tzt $c_tztt $i_tztt $c_tzls $i_tzls END_OF_DATA Installation of system tables failed! Examine the logs in /var/lib/mysql for more information. You can also try to start the mysqld daemon with: /usr/sbin/mysqld --skip-grant & You can use the command line tool /usr/bin/mysql to connect to the mysql database and look at the grant tables: shell> /usr/bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /var/lib/mysql that may be helpful. The latest information about MySQL is available on the web at http://www.mysql.com Please consult the MySQL manual section: 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source is the MySQL email archive. Please check all of the above before mailing us! And if you do mail us, you MUST use the /usr/bin/mysqlbug script! I can reproduce everytime, and it is happening on a complain sain system, up to date x86, with ONLY MYSQL on it. It was running MySQL 4.0 previously wonderfully, I unmerge and cleaned up /var/lib/mysql prior to run the emerge against MySQL 4.1 (for info I unmasked MySQL4.1* and DBD-2.9* and ran the ebuild with x86 keyword) Hope this helps! Reproducible: Always Steps to Reproduce: 1. 2. 3. # emerge info Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.10-gentoo-r6 i686) ================================================================= System uname: 2.6.10-gentoo-r6 i686 Pentium III (Coppermine) Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 7 2005, 21:53:18)] dev-lang/python: 2.3.4-r1 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="cluster erkdb innodb mysql nptl pam perl python ssl tcpd x86" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Where is the log data from /var/lib/mysql that mysql_install_db tells you to look at ? please include the relevant itesm from them.
I have the same bug, with both mysql-4.1.8 and mysql-4.1.8-r1. dev-db/mysql-4.1.8-r1 +berkdb -cluster -debug -innodb +perl +readline -ruby (-selinux) +ssl -static +tcpd The place where it suggests to look for logs contains nothing, just empty dirs: /var/lib/mysql/mysql /var/lib/mysql/test However, we can see the following in /var/log/mysql/mysqld.err: ----------------------------- mysqld got signal 11; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=16777216 read_buffer_size=131072 max_used_connections=0 max_connections=20 threads_connected=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 59903 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd=0x845c688 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... frame pointer (ebp) is NULL, did you compile with -fomit-frame-pointer? Aborting backtrace! Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at (nil) is invalid pointer thd->thread_id=1919247474 The manual page at http://www.mysql.com/doc/en/Crashing.html contains information that should help you find out what is causing the crash. -----------------------------
Follow-up: CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer" CHOST="i686-pc-linux-gnu"
Rebuild with: CFLAGS="-march=pentium3 -ggdb3 -O1" and rebuild, then it should generate a valid backtrace.
The bug depends on the missing mysqld in /usr/bin. After copying it from the sources to /usr/bin the scripts work fine. I have testet it only with mysql4.1.8, but i think its the same bug at the 4.1.7 and 4.1.9.
CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium3 -ggdb3 -O1" ... gcc -shared .libs/libmysql.o .libs/password.o .libs/manager.o .libs/get_passwor d.o .libs/errmsg.o .libs/my_init.o .libs/my_static.o .libs/my_malloc.o .libs/my_ realloc.o .libs/my_create.o .libs/my_delete.o .libs/mf_tempfile.o .libs/my_open. o .libs/my_file.o .libs/my_read.o .libs/my_write.o .libs/errors.o .libs/my_error .o .libs/my_getwd.o .libs/my_div.o .libs/mf_pack.o .libs/my_messnc.o .libs/mf_di rname.o .libs/mf_fn_ext.o .libs/mf_wcomp.o .libs/typelib.o .libs/safemalloc.o .l ibs/my_alloc.o .libs/mf_format.o .libs/mf_path.o .libs/mf_unixpath.o .libs/my_fo pen.o .libs/my_symlink.o .libs/my_fstream.o .libs/mf_loadpath.o .libs/my_pthread .o .libs/my_thr_init.o .libs/thr_mutex.o .libs/mulalloc.o .libs/string.o .libs/d efault.o .libs/my_compress.o .libs/array.o .libs/my_once.o .libs/list.o .libs/my _net.o .libs/charset.o .libs/charset-def.o .libs/hash.o .libs/mf_iocache.o .libs /mf_iocache2.o .libs/my_seek.o .libs/my_sleep.o .libs/my_pread.o .libs/mf_cache. o .libs/md5.o .libs/sha1.o .libs/my_getopt.o .libs/my_gethostbyname.o .libs/my_p ort.o .libs/my_lib.o .libs/strmov.o .libs/strxmov.o .libs/strxnmov.o .libs/strnm ov.o .libs/strmake.o .libs/strend.o .libs/strtod.o .libs/strnlen.o .libs/strfill .o .libs/is_prefix.o .libs/int2str.o .libs/str2int.o .libs/strinstr.o .libs/strc ont.o .libs/strcend.o .libs/bcmp.o .libs/ctype-latin1.o .libs/bchange.o .libs/bm ove.o .libs/bmove_upp.o .libs/longlong2str.o .libs/strtoull.o .libs/strtoll.o .l ibs/llstr.o .libs/my_vsnprintf.o .libs/ctype.o .libs/ctype-simple.o .libs/ctype- bin.o .libs/ctype-mb.o .libs/ctype-big5.o .libs/ctype-czech.o .libs/ctype-euc_kr .o .libs/ctype-win1250ch.o .libs/ctype-utf8.o .libs/ctype-extra.o .libs/ctype-uc s2.o .libs/ctype-gb2312.o .libs/ctype-gbk.o .libs/ctype-sjis.o .libs/ctype-tis62 0.o .libs/ctype-ujis.o .libs/ctype-uca.o .libs/xml.o .libs/my_strtoll10.o .libs/ dbug.o .libs/pack.o .libs/client.o .libs/my_time.o .libs/vio.o .libs/viosocket.o .libs/viossl.o .libs/viosslfactories.o .libs/net.o -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib -lssl -lcrypto -march=pentium3 -Wl,-soname -Wl,libmysqlcl ient_r.so.14 -o .libs/libmysqlclient_r.so.14.0.0 collect2: ld returned 1 exit status distcc[2907] ERROR: compile (null) on localhost failed make[2]: *** [libmysqlclient_r.la] Error 1 make[2]: Leaving directory `/var/tmp/portage/mysql-4.1.8-r1/work/mysql-4.1.8/lib mysql_r' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/mysql-4.1.8-r1/work/mysql-4.1.8' make: *** [all] Error 2 !!! ERROR: dev-db/mysql-4.1.8-r1 failed. !!! Function src_compile, Line 170, Exitcode 2 !!! compile problem !!! If you need support, post the topmost build error, NOT this status message. colinux lib #
> The bug depends on the missing mysqld in /usr/bin. > After copying it from the sources to /usr/bin the scripts work fine. Do you mean /usr/sbin/? My /usr/sbin/mysqld was created successfully by the ebuild. Anyway, symlinking it to /usr/bin/ changed nothing, I am still getting Signal 11.
The mysql_install_db script from mysql5.0.x means that mysqld is missing in /usr/bin so I had copyed it from /var/tmp/portage/mysql-4.1.8/work/mysql-4.1.8/sql to /usr/bin, after this "mysql_install_db --user=mysql"(from mysql4.1.8) hadnt any errors. Try copy mysqld form /usr/sbin to /usr/bin, or grab mysqld out of /var/tmp/portage/mysql-4.1.8/work/mysql-4.1.8/sql while emergeing and put it in /usr/bin. bash-2.05b# mysql_install_db --user=mysql Installing all prepared tables Fill help tables To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, issue the following commands to start the server and change the applicable passwords: /etc/init.d/mysql start /usr/bin/mysqladmin -u root -h draco password 'new-password' /usr/bin/mysqladmin -u root password 'new-password' Depending on your configuration, a -p option may be needed in the last command. See the manual for more details. NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be able to use the new GRANT command! You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory: cd sql-bench ; perl run-all-tests Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at https://order.mysql.com bash-2.05b# bash-2.05b# mysql_install_db --user=mysql Installing all prepared tables Fill help tables To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, issue the following commands to start the server and change the applicable passwords: /etc/init.d/mysql start /usr/bin/mysqladmin -u root -h draco password 'new-password' /usr/bin/mysqladmin -u root password 'new-password' Depending on your configuration, a -p option may be needed in the last command. See the manual for more details. NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be able to use the new GRANT command! You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory: cd sql-bench ; perl run-all-tests Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at https://order.mysql.com bash-2.05b# /usr/bin/mysqld_safe & [1] 31642 bash-2.05b# mysqladmin version mysqladmin Ver 8.41 Distrib 4.1.8, for pc-linux-gnu on i686 Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This software comes with ABSOLUTELY NO WARRANTY. This is freesoftware, and you are welcome to modify and redistribute it under the GPL license Server version 4.1.8 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 10 sec Threads: 1 Questions: 1 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 0 Queries per second avg: 0.100 bash-2.05b#
Recompiled with the debug on and discovered this: colinux root # /usr/sbin/mysqld --skip-grant 050224 19:14:21 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them This reminded me to check timezone settings at my host. And /etc/localtime was missing! So I followed the instruction at: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap7 and my MySQL 4.1 now works! This is important to notice that MySQL 4.0 happily functions even without the timezone, but not 4.1.
the new 4.1 ebuild handles all of this fine.