473,499 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"mysql.h: No such file or directory" when building MySQL-python

Hi.

I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2:
----------------------------------
[ ]# export PATH=$PATH:/usr/local/mysql/bin/
[ ]# export mysqlclient=mysqlclient_r
[ ]# python setup.py clean
[ ]# python setup.py build
running build
running build_py
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.3
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386
-mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.3 -c
_mysql.c -o build/temp.linux-i686-2.3/_mysql.o -I'/usr/include/mysql'
_mysql.c:41:19: mysql.h: No such file or directory
------------------------------------

I don't understand why I get this error message, since I usually build
MySQL+C programs
by using:
gcc -o myprogram -I'/usr/local/mysql/include/mysql'
-L'/usr/local/mysql/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm
myprogram.c

My server configuration:
---------------------------
[ ]# /usr/local/mysql/bin/mysql_config
--cflags [-I'/usr/local/mysql/include/mysql']
--libs [-L'/usr/local/mysql/lib/mysql' -lmysqlclient
-lz -lcrypt -lnsl -lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [3.23.58]
----------------------------
[ ]# find . -name "mysql.h"
../usr/src/php-4.3.10/ext/mysql/libmysql/mysql.h
../usr/src/mysql-3.23.58/include/mysql.h
../usr/src/mysql-4.1.9/include/mysql.h
../usr/include/mysql/mysql.h
../usr/local/mysql/include/mysql/mysql.h
------------------------------
[ ]# locate libmysqlclient
/usr/src/mysql-3.23.58/libmysql/.libs/libmysqlclient.so
/usr/src/mysql-3.23.58/libmysql/.libs/libmysqlclient.a
/usr/src/mysql-3.23.58/libmysql/.libs/libmysqlclient.so.10
/usr/src/mysql-3.23.58/libmysql/.libs/libmysqlclient.so.10.0.0
/usr/src/mysql-3.23.58/libmysql/.libs/libmysqlclient.lai
/usr/src/mysql-3.23.58/libmysql/.libs/libmysqlclient.la
/usr/src/mysql-3.23.58/libmysql/libmysqlclient.la
/usr/src/mysql-4.1.9/libmysql/.libs/libmysqlclient.so
/usr/src/mysql-4.1.9/libmysql/.libs/libmysqlclient.a
/usr/src/mysql-4.1.9/libmysql/.libs/libmysqlclient.so.14
/usr/src/mysql-4.1.9/libmysql/.libs/libmysqlclient.lai
/usr/src/mysql-4.1.9/libmysql/.libs/libmysqlclient.so.14.0.0
/usr/src/mysql-4.1.9/libmysql/.libs/libmysqlclient.la
/usr/src/mysql-4.1.9/libmysql/libmysqlclient.la
/usr/local/mysql/lib/mysql/libmysqlclient.la
/usr/local/mysql/lib/mysql/libmysqlclient.so.10.0.0
/usr/local/mysql/lib/mysql/libmysqlclient.so
/usr/local/mysql/lib/mysql/libmysqlclient.a
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
----------------------------------

Any suggestion? Thank you very much.

Jul 19 '05 #1
2 10257
fr**********@europe.com wrote:
I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: .... gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386
-mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.3 -c
_mysql.c -o build/temp.linux-i686-2.3/_mysql.o -I'/usr/include/mysql'
_mysql.c:41:19: mysql.h: No such file or directory .... My server configuration:
---------------------------
[ ]# /usr/local/mysql/bin/mysql_config
--cflags [-I'/usr/local/mysql/include/mysql']
--libs [-L'/usr/local/mysql/lib/mysql' -lmysqlclient
-lz -lcrypt -lnsl -lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [3.23.58] .... Any suggestion? Thank you very much.


Fedora's mysql_config puts quotes around the directory names, which
confuses things. Try MySQL-python-1.2.1c1. I don't think this entirely
solves the problem, but I think I know how to fix it for 1.2.1c2. But
try it and report your results here:

https://sourceforge.net/tracker/inde...07&atid=374932

Jul 19 '05 #2
Thank you Andy for your answer.

I tried by using '1.2.1c1' and '1.2.1c2', but with no success:
---------------
creating build/temp.linux-i686-2.3
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386
-mcpu=i686 - D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.3 -c
_mysql.c -o build/temp.linu x-i686-2.3/_mysql.o -I'/usr/include/mysql'
_mysql.c:41:19: mysql.h: No such file or directory
--------------------

Finally I decided to copy '/usr/include/mysql/*.*' to my work
directory,
and I managed to build it. But when trying to execute a simple test,
I get this error message:
---------
Traceback (most recent call last):
File "./db.py", line 7, in ?
db = "test")
File "/usr/lib/python2.3/site-packages/MySQLdb/__init__.py", line 66,
in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line
134, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, "Can't connect to local
MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
-----------------------

Any suggestion?. Regards
Andy Dustman wrote:
fr**********@europe.com wrote:
I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ...
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386
-mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.3 -c
_mysql.c -o build/temp.linux-i686-2.3/_mysql.o -I'/usr/include/mysql' _mysql.c:41:19: mysql.h: No such file or directory

...
My server configuration:
---------------------------
[ ]# /usr/local/mysql/bin/mysql_config
--cflags [-I'/usr/local/mysql/include/mysql']
--libs [-L'/usr/local/mysql/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [3.23.58]

...
Any suggestion? Thank you very much.


Fedora's mysql_config puts quotes around the directory names, which
confuses things. Try MySQL-python-1.2.1c1. I don't think this

entirely solves the problem, but I think I know how to fix it for 1.2.1c2. But
try it and report your results here:

https://sourceforge.net/tracker/inde...07&atid=374932

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4728
by: StevePBurgess | last post by:
I would like to make my downloads section unbrowsable (to users) but accessible to scripts. Can I deliver a file to a browser without linking to it's URL so that I can deliver files...
9
715
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit...
0
1309
by: Mec | last post by:
Some time ago I created a windows forms application with a deployment project. I was always able to build the deployment package after changing the windows forms application, but somehow something...
2
1996
by: news.bellatlantic.net | last post by:
I created a for with file inputs (<input type=file.../>) I named them file1, file2, file3 etc. How do I access them in the code behind without actually calling each one by name (there are 21 of...
2
1564
by: Philipp Schumann | last post by:
Dear all, I'm in the process of designing a distributed application on the basis of ASP.NET, which does not contain of scripts, but of assemblies containing classes that implement IHttpHandler...
6
25998
by: John Doe | last post by:
Hi, I've got the following error when building my ASP.NET application called WebApplication1: Preparing resources... Updating references... Performing main compilation... error CS0006:...
4
3267
by: johnb41 | last post by:
In my application, the user opens up a Tiff image. (The file does NOT necessarily have to be the first file in the folder; it could by anywhere.) When i'm done viewing (doing whatever) with the...
1
9785
by: techBoy | last post by:
I installed MySQL4.0. No for creating a databse the help says like go to "mysql>" prompt and then enter some commands. How do I get this prompt ??
2
6887
by: Remi.Arntzen | last post by:
I tried to compile a program to a elf shared library for a Linux platform on a windows machine with the command: gcc -o Prog.so -shared -Wl,--oformat -Wl,elf32-i386 however this results in ld:...
21
7792
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.