473,703 Members | 2,764 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=mys qlclient_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 10278
fr**********@eu rope.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(*arg s, **kwargs)
File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py" , line
134, in __init__
super(Connectio n, self).__init__( *args, **kwargs2)
_mysql_exceptio ns.OperationalE rror: (2002, "Can't connect to local
MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
-----------------------

Any suggestion?. Regards
Andy Dustman wrote:
fr**********@eu rope.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
4751
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 programmatically but prevent users from browsing or linking to them? I am using PHP on an apache server. Ta
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 anyway).... Private Sub LogChange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs) If e.ChangeType = WatcherChangeTypes.Created Then
0
1322
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 changed. When I try to build the deployment project, it builds the windows application without errors, but when packaging I now get the following error: "File not found <Filename>, Interface not supported". When checking <Filename>, it...
2
2009
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 them). This is what I have so far. Strangely I get a error some of the time, I have not isolated it because I can't get it to go to debug. The code below kind of works about every 3rd one gives me an error and I can't get it to go to debug! I get...
2
1576
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 to mimic script-like behaviour. The following section in web.config enables this particular kind of assembly usage. <httpHandlers>
6
26026
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: Metadata file 'c:\inetpub\wwwroot\WebApplication1\bin\WebApplication1.dll' could not be
4
3283
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 image I need to open up the "Next" Tiff file in the folder. This should be done by clicking a button instead of using the FileOpen dialog again and again. Here is my approach, which isn't working: Private Sub BtnNext_Click(ByVal sender As...
1
9794
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
6926
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: cannot perform PE operations on non PE output file When compiling to PE format no errors are generated, which leads me to believe that some post processing operations are being preformed. This error message does not help me figure what PE operations...
21
7843
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
8739
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8654
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8941
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6575
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5910
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2406
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2037
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.