Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Where can I find the include files for MySQL on Linux? I looked in /usr/include/mysql according to this but they are not there. My apache web server works fine with MySQL 5.1 up and running with PHP 5, but I can't find where the includes directory is!!

Thanks for your help!

share|improve this question
    
what distro are you using? –  Ophidian Feb 22 '10 at 2:41
    
Ubuntu 8.10 is the distro –  deownefin Feb 22 '10 at 2:52
add comment

2 Answers

up vote 1 down vote accepted
$ mysql_config --include

On my system, this prints -I/usr/include/mysql

If the directory revealed by mysql_config doesn't have the right include files, your installation may have been partial or may have been altered after the fact.

From the documentation:

mysql_config provides you with useful information for compiling your MySQL client and connecting it to MySQL....

--include

Compiler options to find MySQL include files.

share|improve this answer
    
Thanks! for the response –  deownefin Feb 22 '10 at 3:08
add comment

This really depends on the Linux distro you are using. Most binary distros ship the headers separate from the application itself, often in a -devel package.

For instance, on my Fedora 12 machine the mysql-devel package has the following description:

MySQL is a multi-user, multi-threaded SQL database server. This package contains the libraries and header files that are needed for developing MySQL client applications.

On Fedora, CentOS, or RHEL,you can install this package by yum install mysql-devel as root. Debian and Ubuntu systems will have a similar package name and command for apt.

share|improve this answer
    
Interesting thanks for your answer! –  deownefin Feb 22 '10 at 3:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.