Hi everyone!
I have to make php with the mysql option to use my mysql database but there is something wrong and I didn't find the solution... This is the error message :
configure: error: Cannot find MySQL header files under /usr/include/mysql

There is how I remake php :
$> ./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include/mysql

In /usr/include/mysql I have the header files as you can see below :
chardefs.h
errmsg.h
history.h
keycache.h
keymaps.h
libmysqlclient_r.so
libmysqlclient_r.so.10
libmysqlclient_r.so.10.0.0
libmysqlclient_r.so.12
libmysqlclient_r.so.12.0.0
libmysqlclient_r.so.14
libmysqlclient_r.so.14.0.0
libmysqlclient.so
libmysqlclient.so.10
libmysqlclient.so.10.0.0
libmysqlclient.so.12
libmysqlclient.so.12.0.0
libmysqlclient.so.14
libmysqlclient.so.14.0.0
m_ctype.h
m_string.h
my_alloc.h
my_config.h
my_dbug.h
my_dir.h
my_getopt.h
my_global.h
my_list.h
my_net.h
my_no_pthread.h
my_pthread.h
my_semaphore.h
mysql_com.h
mysqld_error.h
mysql_embed.h
mysql.h
mysql_time.h
mysql_version.h
my_sys.h
my_xml.h
raid.h
readline.h
rlmbutil.h
rlprivate.h
rlshell.h
rltypedefs.h
sql_common.h
sql_state.h
sslopt-case.h
sslopt-longopts.h
sslopt-vars.h
tilde.h
typelib.h
xmalloc.h

I have put libmysqlclient.so in /usr/include/mysql so that all files needed by php are in the same directory but NOTHING! It's not working!

PLEASE, ANY IDEA?!

    3 months later

    When using the with-mysql option you must point it to the installation directory....NOT the include directory itself.

    In my case i would use with-mysql=/usr/local/mysql

      a month later

      try others path..

      --with-mysql-dir=/usr/

      keep trying.....
      I get it right for the above path

      cheers~
      🙂

        13 days later

        I did the

        --with-mysql-dir=/usr/

        thing, and life is good once again.

        thank god, I was really getting pissed off.

        THANK YOU :rolleyes:

          2 years later

          create symb link for mysql_config

          sudo ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config

          HTH

          kurund

            a year later

            Having spend some time figuring this one out here is the answer (for me at least)

            You need to install the MySQL-develp package

            eg.

            MySQL-devel-5.0.67-0.i386.rpm

            and also amend you configure script to --enable-mysql=/<path>

            where <path> is typically /usr

            happy building.

              5 months later

              Hello,

              Just a follow-up for whatever is worth. I had the same problem and resolved by installing MySQL-devel-community-5.1.30-0.rhel5.i386.rpm.

              Martin

                a year later

                Hi ...

                You need to install the lib mysql!

                In Debian or Ubuntu: aptitude install libmysql++-dev

                Telmo Lemos da Rosa

                biker007fr;10627948 wrote:

                Hi everyone!
                I have to make php with the mysql option to use my mysql database but there is something wrong and I didn't find the solution... This is the error message :
                configure: error: Cannot find MySQL header files under /usr/include/mysql

                There is how I remake php :
                $> ./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include/mysql

                In /usr/include/mysql I have the header files as you can see below :
                chardefs.h
                errmsg.h
                history.h
                keycache.h
                keymaps.h
                libmysqlclient_r.so
                libmysqlclient_r.so.10
                libmysqlclient_r.so.10.0.0
                libmysqlclient_r.so.12
                libmysqlclient_r.so.12.0.0
                libmysqlclient_r.so.14
                libmysqlclient_r.so.14.0.0
                libmysqlclient.so
                libmysqlclient.so.10
                libmysqlclient.so.10.0.0
                libmysqlclient.so.12
                libmysqlclient.so.12.0.0
                libmysqlclient.so.14
                libmysqlclient.so.14.0.0
                m_ctype.h
                m_string.h
                my_alloc.h
                my_config.h
                my_dbug.h
                my_dir.h
                my_getopt.h
                my_global.h
                my_list.h
                my_net.h
                my_no_pthread.h
                my_pthread.h
                my_semaphore.h
                mysql_com.h
                mysqld_error.h
                mysql_embed.h
                mysql.h
                mysql_time.h
                mysql_version.h
                my_sys.h
                my_xml.h
                raid.h
                readline.h
                rlmbutil.h
                rlprivate.h
                rlshell.h
                rltypedefs.h
                sql_common.h
                sql_state.h
                sslopt-case.h
                sslopt-longopts.h
                sslopt-vars.h
                tilde.h
                typelib.h
                xmalloc.h

                I have put libmysqlclient.so in /usr/include/mysql so that all files needed by php are in the same directory but NOTHING! It's not working!

                PLEASE, ANY IDEA?!

                  Write a Reply...