Upgraded mysql from 4.0.20-r1 to 4.0.22 during the process of normal upgrade world, now when trying to use mysql on command line I get the following error: mysql: symbol lookup error: mysql: undefined symbol: mysql_get_parameters an already established mysql connection still works, and programs that use the mysql.sock still work, but I cant begin new connections. Whats worse is that now the ebuild for the older version is gone, which prevents me from using it to go back to my working version Reproducible: Always Steps to Reproduce: 1. emerge mysql 2. /etc/init.d/mysql restart 3. mysql -p Actual Results: mysql: symbol lookup error: mysql: undefined symbol: mysql_get_parameters Expected Results: successfully started a new mysql connection Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.4.27-JB i686) ================================================================= System uname: 2.4.27-JB i686 Pentium III (Coppermine) Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux-headers-2.4.19-r1,sys-kernel/linux-headers-2.4.21-r1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=i686 -O3 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=i686 -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms" GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow acl berkdb crypt gdbm innodb jpeg mmx mysql ncurses pam perl perlsuid png python readline snmp sse ssl tcpd xml zlib"
sounds like your mysql client is from a much older mysql, or your libmysqlclient.so is misssing. please put up the output from 'ldd `which mysql`'. in your description you note that an already established connection to mysql still works, but how was this connection made, given that you restarted mysqld.
Here is the ldd output: server1 root # ldd `which mysql` libreadline.so.4 => /lib/libreadline.so.4 (0x4001b000) libncurses.so.5 => /lib/libncurses.so.5 (0x40049000) libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0x4008e000) libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1 (0x40157000) libmysqlclient.so.12 => /usr/lib/mysql/libmysqlclient.so.12 (0x40160000) libz.so.1 => /lib/libz.so.1 (0x40184000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x40195000) libnsl.so.1 => /lib/libnsl.so.1 (0x401c3000) libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0x401d8000) libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0x40208000) libm.so.6 => /lib/libm.so.6 (0x40304000) libc.so.6 => /lib/libc.so.6 (0x40326000) libdl.so.2 => /lib/libdl.so.2 (0x4043a000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) The mysql connection had to reconnect to the daemon, but the client had been running for some time. Here is what I did: mysql> show databases; ERROR 2006: MySQL server has gone away No connection. Trying to reconnect... Connection id: 7818 Current database: vpopmail +----------------------------+ | Database | +----------------------------+ +----------------------------+ 9 rows in set (0.00 sec) mysql> Also, looking at the mysql binary, it is dated the day I did the installation: -rwxr-xr-x 1 root root 65268 Dec 1 23:28 /usr/bin/mysql
This appears to be an issue of old libraries on my system causing confusion. I had mysql libraries in /usr/lib and /usr/lib/mysql. The copy of libmysqlclient.so.12.0.0 in /usr/lib/mysql was much older than the copy in /usr/lib. After renaming this file and then creating a symbolic link from /usr/lib/mysql/libmysqlclient.so.12.0.0 to point to /usr/lib/libmysqlclient.so.12, everything seems to be working again.