472,789 Members | 978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

"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 10181
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
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
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
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
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
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
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
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
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
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
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
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.