mysql - missing libmysqlclient.so.18

I am writing a C program to run as a cron job on a linux server and do some calculations in the MySql DB.

I have Ubuntu 8.04.3 and MySql 5.5.

I am including <mysql.h>, but when I run the program, I get:
error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

Adapting what I found via Google, I tried
sudo apt-get install libmysqlclient18-dev
only to be told
E: Couldn't find package libmysqlclient18-dev

What do I need to do to resolve this?

Thanks!
LVL 32
Daniel WilsonAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
legolasthehansyConnect With a Mentor Commented:
The system still doesn't see your libraries under /opt/. The ldconfig was meant to check whether it was doing that or not.

Let's do it another way.
Open /etc/ld.so.conf
Remove "Include /opt..."
Save and exit

Create a new file under /etc/ld.so.conf.d/ as opt_lib.conf
Add the line "/opt/mysql/server-5.5/lib"
Save and exit
Run "ldconfig -v | grep libmysqlclient"
See if the path shows up. (/opt..)
0
 
legolasthehansyCommented:
Try this
Under /usr/local/mysql/lib (or wherever you MySQL libraries live)
do "ls -l | grep libmysqlclient*"
If you do find libmysqlclient.so.15 or libmysqlclient.so.16
do
cd /usr/local/mysql/lib
#create a soft link
ln -s libmysqlclient.so.15 libmysqlclient.so.16
ldconfig

Good luck
0
 
vvojtekCommented:
Hi,

Did you update apt source ?

apt-get update and then try install
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Daniel WilsonAuthor Commented:
running apt-get update prior to the install didn't help.

As for the soft link ... I'm looking for the right place to do that.

dwilson@williamston:/$ sudo find / -name 'libmysqlclient*' 2>/dev/null
/var/lib/dpkg/info/libmysqlclient15off.list
/var/lib/dpkg/info/libmysqlclient15off.shlibs
/var/lib/dpkg/info/libmysqlclient15off.postinst
/var/lib/dpkg/info/libmysqlclient15off.postrm
/var/lib/dpkg/info/libmysqlclient15off.md5sums
/var/cache/apt/archives/libmysqlclient15off_5.0.51a-3ubuntu5.4_i386.deb
/var/cache/apt/archives/libmysqlclient15off_5.0.95-0ubuntu1_i386.deb
/var/cache/apt/archives/libmysqlclient15off_5.0.51a-3ubuntu5.7_i386.deb
/var/cache/apt/archives/libmysqlclient15off_5.0.51a-3ubuntu5.5_i386.deb
/var/cache/apt/archives/libmysqlclient15off_5.0.51a-3ubuntu5.8_i386.deb
/opt/mysql/server-5.5/lib/libmysqlclient_r.a
/opt/mysql/server-5.5/lib/libmysqlclient_r.so.18.0.0
/opt/mysql/server-5.5/lib/libmysqlclient_r.so
/opt/mysql/server-5.5/lib/libmysqlclient.so
/opt/mysql/server-5.5/lib/libmysqlclient_r.so.18
/opt/mysql/server-5.5/lib/libmysqlclient.so.18
/opt/mysql/server-5.5/lib/libmysqlclient.so.18.0.0
/opt/mysql/server-5.5/lib/libmysqlclient.a
/usr/share/doc/libmysqlclient15off
/usr/lib/libmysqlclient.so.15.0.0
/usr/lib/libmysqlclient_r.so.15.0.0
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient_r.so.15

So, there are some .18 files somewhere ... on the /opt ... area.  Would that be an optical disk in the drive?  Or does that mean something else?  It does appear that MySql 5.5 does want version 18 of the client files.

Suggestions on how to proceed?

Thanks!
0
 
legolasthehansyCommented:
Your libraries are under /opt and the system is unable to find it.
vi /etc/ld.so.conf
Add /opt/mysql/server-5.5/lib

Save and exit
Run ldconfig again and see if the library is being picked up
0
 
Daniel WilsonAuthor Commented:
OK, w/ the change I'm about to save, ld.so.conf says
include /etc/ld.so.conf.d/*.conf
include /opt/mysql/server-5.5/lib

Does that look right?  You didn't say "include" but that's what the previous line said.

Thanks!
0
 
legolasthehansyCommented:
Yes, I meant include
0
 
Daniel WilsonAuthor Commented:
Thanks for your help ... we're not there yet.

dwilson@williamston:/$ sudo ldconfig
[sudo] password for dwilson:
dwilson@williamston:/$ cd /home/dwilson/c_utilities/
dwilson@williamston:~/c_utilities$ ./CalculatePeaks
./CalculatePeaks: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
dwilson@williamston:~/c_utilities$ cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
include /opt/mysql/server-5.5/lib

The changed library is showing up in the configuration:
 mysql_config --libs
-L/opt/mysql/server-5.5/lib -lmysqlclient -lpthread -lm -lrt -ldl

I even re-compiled and re-ran the utility ... no change.

What can I try next?

Thanks.
0
 
legolasthehansyCommented:
Can you try "ldconfig -v | grep libmysqlclient"

Also probably CalculatePeaks is looking for mysqlclient at a standard location?
Try a trace "strace /home/dwilson/c_utilities/CalculatePeaks"
0
 
Daniel WilsonAuthor Commented:
sudo ldconfig -v | grep libmysqlclient
[sudo] password for dwilson:
/sbin/ldconfig.real: Can't stat /lib64: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib64: No such file or directory
        libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
        libmysqlclient.so.15 -> libmysqlclient.so.15.0.0

Open in new window


So ... that looks like some stuff is invalid.

whoa, strace gave us a lot:
 
strace /home/dwilson/c_utilities/CalculatePeaks
execve("/home/dwilson/c_utilities/CalculatePeaks", ["/home/dwilson/c_utilities/Calcul"...], [/* 18 vars */]) = 0
brk(0)                                  = 0x804a000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a5000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=18928, ...}) = 0
mmap2(NULL, 18928, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb77a0000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/i686/cmov", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/lib/tls/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/i686", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/lib/tls/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/tls/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/sse2", 0xbffc5f90)     = -1 ENOENT (No such file or directory)
open("/lib/tls/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/cmov", 0xbffc5f90)     = -1 ENOENT (No such file or directory)
open("/lib/tls/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/lib/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i686/sse2", 0xbffc5f90)    = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i686/cmov", 0xbffc5f90)    = -1 ENOENT (No such file or directory)
open("/lib/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i686", 0xbffc5f90)         = -1 ENOENT (No such file or directory)
open("/lib/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/sse2/cmov", 0xbffc5f90)    = -1 ENOENT (No such file or directory)
open("/lib/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/sse2", 0xbffc5f90)         = -1 ENOENT (No such file or directory)
open("/lib/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/cmov", 0xbffc5f90)         = -1 ENOENT (No such file or directory)
open("/lib/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
open("/usr/lib/tls/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/i686/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/i686", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/tls", 0xbffc5f90)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i686/cmov", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i686", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/sse2", 0xbffc5f90)     = -1 ENOENT (No such file or directory)
open("/usr/lib/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/cmov", 0xbffc5f90)     = -1 ENOENT (No such file or directory)
open("/usr/lib/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
open("/lib/i486-linux-gnu/tls/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/i686/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/i686", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/tls/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/tls", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/i686/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/i686", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/lib/i486-linux-gnu/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/i486-linux-gnu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/i486-linux-gnu/tls/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/i686/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/i686", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/tls/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/tls", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/i686/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/i686/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/i686/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/i686/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/i686/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/i686/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/i686/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/i686", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/sse2/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/sse2/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/sse2/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/sse2", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/cmov/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu/cmov", 0xbffc5f90) = -1 ENOENT (No such file or directory)
open("/usr/lib/i486-linux-gnu/libmysqlclient.so.18", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i486-linux-gnu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
writev(2, [{"/home/dwilson/c_utilities/Calcul"..., 40}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libmysqlclient.so.18", 20}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, {"\n", 1}], 10/home/dwilson/c_utilities/CalculatePeaks: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
) = 160
exit_group(127)                         = ?
Process 15048 detached

Open in new window

0
 
Daniel WilsonAuthor Commented:
My c code is very simple.  In fact ... I just tried the example from http://www.cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program.html with the same results.
0
 
Daniel WilsonAuthor Commented:
Having changed /etc/ld.so.conf and creaetd opt_lib.conf ...

dwilson@williamston:/etc/ld.so.conf.d$ sudo ldconfig -v | grep libmysqlclient
/sbin/ldconfig.real: Can't stat /lib64: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib64: No such file or directory
        libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
        libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
        libmysqlclient.so.15 -> libmysqlclient.so.15.0.0

Open in new window


And, trying to run the programs, we get a different error:
dwilson@williamston:~/c_utilities$ ./MySqlTest
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
dwilson@williamston:~/c_utilities$ ./CalculatePeaks
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
dwilson@williamston:~/c_utilities$

Open in new window


I think ... this may be progress!
0
 
legolasthehansyCommented:
Ok - That's because you don't have Mysql server running, perhaps? Or the mysql server is running but has the socket somewhere else.

ps -ef | grep mysql
0
 
Daniel WilsonAuthor Commented:
It's definitely running!  My PHP site is still up -- querying the database on nearly every page.

 ps -ef | grep mysql
mysql     4449     1  0 Mar19 ?        00:00:00 /bin/sh /opt/mysql/server-5.5/bin/mysqld_safe
mysql     4909  4449  3 Mar19 ?        01:26:46 /opt/mysql/server-5.5/bin/mysqld --basedir=/opt/mysql/server-5.5 --datadir=/var/lib/mysql --plugin-dir=/opt/mysql/server-5.5/lib/plugin --log-error=/var/lib/mysql/williamston.err --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
dwilson  17953 17001  0 20:23 pts/1    00:00:00 grep mysql
0
 
Daniel WilsonAuthor Commented:
Ah, what I just posted ... I think ... says the socket is in /var/run/mysqld/mysqld.sock instead of /tmp/mysql.sock.

http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/

Now ... if I can tell my C program to use the right socket ... maybe I'll be in business!
0
 
Daniel WilsonAuthor Commented:
You solved the problem I presented.  I'm having another problem ... but I'll treat it as another problem.  Thanks for your help & patience!
0
 
Daniel WilsonAuthor Commented:
Just had to pay attention to the arguments to mysql_real_connect
http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html

Thanks again!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.