Discussion:
can't find mysql.h
John Reid
2011-12-09 23:22:18 UTC
Permalink
I recently purchased i386 Debian 6.0.3 which included LAMP.

I have got my server up and working (with no GUIs) and I am talking to it
via ftp and Apache from clients on the LAN. Works fine. MySQL works fine
from the command line.

But I can't find mysql.h and various mysql libraries required when running
MySQL as an API from C code, i.e.

find / | grep mysql.h

draws a blank.

I have tried apt-get on libmysqlclient-dev and mysql-server-5.1. apt-get
tells me the latter is up-to-date. Whatever. I still can't find mysql.h.
Has the use of C header files within Debian Linux been deprecated or am I
doing something wrong?

I have spent days searching the Web for some clues on this but nothing
seems relevant. Should I uninstall mysql-server-5.1 and then install it
again? I am cautious about copying libraries and include files from
elsewhere if they are not part of a Debian package.



_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Robin Paulson
2011-12-09 23:32:38 UTC
Permalink
Post by John Reid
I have tried apt-get on libmysqlclient-dev and mysql-server-5.1. apt-get
tells me the latter is up-to-date. Whatever. I still can't find mysql.h.
according to this:
http://packages.ubuntu.com/search?searchon=contents&keywords=mysql.h&mode=exactfilename&suite=oneiric&arch=any

it should be in:
/usr/include/mysql/mysql.h

i imagine it will be in the same place in debian, i'm sure they will
have a similar package search interface online

have you manually looked in that directory?

have you tried downloading the .deb manually, extracting the files and
looking in there?
--
robin

http://fu.ac.nz - Auckland's Free University

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Nick Rout
2011-12-09 23:49:15 UTC
Permalink
Post by John Reid
I recently purchased i386 Debian 6.0.3 which included LAMP.
I have got my server up and working (with no GUIs) and I am talking to it
via ftp and Apache from clients on the LAN. Works fine. MySQL works fine
from the command line.
But I can't find mysql.h and various mysql libraries required when running
MySQL as an API from C code, i.e.
find / | grep mysql.h
draws a blank.
I have tried apt-get on libmysqlclient-dev
that's where it will be. what is the output of

dpkg -L libmysqlclient-dev

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
John Reid
2011-12-10 02:45:48 UTC
Permalink
Robin

ls -l /usr/iclude/mysql

returns "... No such file or directory"

You say
"have you tried downloading the .deb manually, extracting the files and
looking in there?"

Download where from? I purchased 6 CDs precisely to avoid this sort of
problem. I guess I could look on them.


Nick

dpkg -L libmysqlclient-dev

returns "Package `libmysqlclient-dev' is not installed.
Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg
--contents (= dpkg-deb --contents) to list their contents."

apt-get install libmysqlclient-dev

returns "Package 'libmysqlclient-dev' is not available, but is referred to
by another package.
This may mean that the package is missing, has been obsoleted, or is only
available from another source
However the following packages replace it:
mysql-server-5.1
E: Package 'libmysqlclient-dev' has no installation candidate"

apt-get install mysql-server-5.1

returns "Reading package lists...
Building dependency tree...
Reading state information...
mysql-server-5.1 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."

Can I force installation of libmysqlclient-dev?
Should I?




_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
David Pando
2011-12-10 03:03:43 UTC
Permalink
Post by Nick Rout
dpkg -L libmysqlclient-dev
returns "Package `libmysqlclient-dev' is not installed.
Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg
--contents (= dpkg-deb --contents) to list their contents."
apt-get install libmysqlclient-dev
returns "Package 'libmysqlclient-dev' is not available, but is referred to
by another package.
This may mean that the package is missing, has been obsoleted, or is only
available from another source
mysql-server-5.1
E: Package 'libmysqlclient-dev' has no installation candidate"
apt-get install mysql-server-5.1
returns "Reading package lists...
Building dependency tree...
Reading state information...
mysql-server-5.1 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."
Can I force installation of libmysqlclient-dev?
Should I?
Try installing the libmysqlclient15-dev package .

# dpkg-query -S /usr/include/mysql/mysql.h
libmysqlclient15-dev: /usr/include/mysql/mysql.h
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Andrew Simpson
2011-12-10 03:10:04 UTC
Permalink
On Sat, 10 Dec 2011 13:45:48 +1100 (EST)
Post by Steve Holdoway
apt-get install libmysqlclient-dev
returns "Package 'libmysqlclient-dev' is not available, but is referred to
by another package.
This may mean that the package is missing, has been obsoleted, or is only
available from another source
mysql-server-5.1
E: Package 'libmysqlclient-dev' has no installation candidate"
Something not right there, I get this:

# apt-get install -s libmysqlclient-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libmysqlclient-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst libmysqlclient-dev (5.1.49-3 Debian:6.0.3/stable [i386])
Conf libmysqlclient-dev (5.1.49-3 Debian:6.0.3/stable [i386])

(The -s switch means 'simulate' or 'dry-run').

Checking the file list does indeed show the file you want is in that package.

Andrew

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Robin Paulson
2011-12-10 03:42:51 UTC
Permalink
Post by John Reid
Robin
ls -l /usr/iclude/mysql
returns "... No such file or directory"
You say
"have you tried downloading the .deb manually, extracting the files and
looking in there?"
Download where from? I purchased 6 CDs precisely to avoid this sort of
problem. I guess I could look on them.
http://packages.debian.org

specifically:
http://packages.debian.org/squeeze/libmysqlclient-dev

if i download the package and unpack it manually, the file is there in
/usr/include/mysql/

what i was getting at is there is no problem with the package being
installed from the debian servers. so, it looks like the problem is on
your computer

it installed fine here, and the file is now at
/usr/include/mysql/mysql.h
--
robin

http://fu.ac.nz - Auckland's Free University

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
David L Neil
2011-12-10 04:04:32 UTC
Permalink
John,
Post by John Reid
Robin
ls -l /usr/iclude/mysql
returns "... No such file or directory"
iNclude!?
--
Regards,
=dn

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
John Reid
2011-12-11 22:20:33 UTC
Permalink
Thanks everyone for your input. Your suggestions gave me some perspective
even if I didn't use them specifically.

Steve Holdaway's suggestion worked, viz:

1. Append the on-line packages to source.list

***@debian:~# echo deb http://packages.dotdeb.org squeeze all >>
/etc/apt/sources.list

2. Update and upgrade

***@debian:~# apt-get update
***@debian:~# apt-get upgrade

3. Install libmysqlclient

***@debian:~# apt-get install libmysqlclient-dev

/usr/include/mysql now has some .h files in it


I have not worked in a development environment for 10 years. I had some
catching up to do.

Cheers

John




_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug

Steve Holdoway
2011-12-10 01:51:35 UTC
Permalink
Post by John Reid
I recently purchased i386 Debian 6.0.3 which included LAMP.
I have got my server up and working (with no GUIs) and I am talking to it
via ftp and Apache from clients on the LAN. Works fine. MySQL works fine
from the command line.
But I can't find mysql.h and various mysql libraries required when running
MySQL as an API from C code, i.e.
find / | grep mysql.h
draws a blank.
I have tried apt-get on libmysqlclient-dev and mysql-server-5.1. apt-get
tells me the latter is up-to-date. Whatever. I still can't find mysql.h.
Has the use of C header files within Debian Linux been deprecated or am I
doing something wrong?
I have spent days searching the Web for some clues on this but nothing
seems relevant. Should I uninstall mysql-server-5.1 and then install it
again? I am cautious about copying libraries and include files from
elsewhere if they are not part of a Debian package.
Purchased?

apt-get install libmysqlclient-dev

should do it. If you're looking to keep more up to date but losing the
advantages of the mainstream debian ( mainly the volume of testing ),
then

echo deb http://packages.dotdeb.org squeeze all >> /etc/apt/sources.list
apt-get update && apt-get upgrade

beforehand. This will upgrade you to mysql 5.5, php 5.3.8 and a few
others which may be of use.

( sudo will be needed if not superuser ).

hth,

Steve
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Loading...