473,574 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python and MySQL

I appologize in advance for this strange (and possibly stupid)
question.

I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionality?

Nov 2 '05 #1
13 2029
[Aquarius]
I appologize in advance for this strange (and possibly stupid)
question.

I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionality?


Possibly not want you want to hear, but I'd strongly recommend to stop
wasting your time with a hosting company that doesn't support the
technologies you need.

Instead, try a hosting company that supports python: there are lots and lots

http://wiki.python.org/moin/PythonHosting

Life's too short to spend your time hacking around artificial barriers
to progress.

--
alan kennedy
------------------------------------------------------
email alan: http://xhaus.com/contact/alan
Nov 2 '05 #2
Aquarius wrote:
I appologize in advance for this strange (and possibly stupid)
question.

I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionality?

You'll definitely need something to call the database API functions, I
suspect.

You could do a *private* install of the module though, surely, on your
web host?

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 2 '05 #3
Aquarius wrote:
I appologize in advance for this strange (and possibly stupid)
question.

I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionality?


I assume that MySQL clients talk to servers via sockets, and it should
be possible to write a python client that did that. It's probably some
work though, and it will probably piss MySQL AB off, since it means that
you could write MySQL client apps using whatever license you want
without paying them.

I wrote a prototype for such a client lib for PostgreSQL once, and it
was fairly simple, but the PostgreSQL docs have decent descriptions of
their protocol, while I assume MySQL hasn't since they want people to
use their client libs and pay for that. (If you read the client lib
source and translate that to Python, it should be considered a derivate,
and GPL applies. If you manage to get it to work without reading any
GPLed code, I guess you are entitled to use whatever license you want.)
Disclaimer: IANAL.
Nov 2 '05 #4
"Aquarius" <st**********@g mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I appologize in advance for this strange (and possibly stupid)
question.

I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionality?


Well, I'm looking at the source for the ever popular MySQLdb library. It
appears to be nothing but straight up Python source code. I see no reason
why you couldn't just take these modules and put them in your own private
directory. There is nothing secret here.

But

As others have already pointed out, after you go to this trouble, your
hosting provider will still suck! I'm sure you can you can get lot's of
suggestions for a suitable replacement.

Thomas Bartkus
Nov 2 '05 #5
Thomas Bartkus wrote:
"Aquarius" <st**********@g mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I appologize in advance for this strange (and possibly stupid)
question.

I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionality ?

Well, I'm looking at the source for the ever popular MySQLdb library. It
appears to be nothing but straight up Python source code. I see no reason
why you couldn't just take these modules and put them in your own private
directory. There is nothing secret here.

But

As others have already pointed out, after you go to this trouble, your
hosting provider will still suck! I'm sure you can you can get lot's of
suggestions for a suitable replacement.

I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you?

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 2 '05 #6
"Steve Holden" <st***@holdenwe b.com> wrote in message
news:ma******** *************** **************@ python.org...
Thomas Bartkus wrote:
Well, I'm looking at the source for the ever popular MySQLdb library. It
appears to be nothing but straight up Python source code. I see no reason
why you couldn't just take these modules and put them in your own private directory. There is nothing secret here.

I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you?


You made me give that library a good hard stare.

And no - everything is enunciated in clear Python (.py) code with
corresponding (.pyc) and (.pyo). It appears we have Python source for
everything.

FWIW:
print MySQLdb.version _info

(1, 2, 0, 'final', 1)

There doesn't seem to be .c code to be found anywhere.
Thomas Bartkus
Nov 2 '05 #7
Thomas Bartkus wrote:
"Steve Holden" <st***@holdenwe b.com> wrote in message
news:ma******** *************** **************@ python.org...
Thomas Bartkus wrote:
Well, I'm looking at the source for the ever popular MySQLdb library. It
appears to be nothing but straight up Python source code. I see no
reason
why you couldn't just take these modules and put them in your own
private
directory. There is nothing secret here.


I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you?

You made me give that library a good hard stare.

And no - everything is enunciated in clear Python (.py) code with
corresponding (.pyc) and (.pyo). It appears we have Python source for
everything.

FWIW:

print MySQLdb.version _info


(1, 2, 0, 'final', 1)

OK. I saw that my own version was (1, 0, 0, 'final', 1), so I assumed
Andy's updated the package somewhat. However, downloading the source of
1.2 I see that _mysql.c still appears, and that the package's
__init__.py still includes the line

include _mysql

My C:\Python24\Lib \site-packages directory does contain a _mylsql.pyd
file. Would you like to check that we are talking about the same module?

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 3 '05 #8
I am also have _mysql.c that has to be compiled. I downloaded 1.2.0
from here
http://sourceforge.net/project/showf...ckage_id=15775
(the .tar.gz). Do you mean, that if I drop the import _mysql and from
_mysql import ... lines everything will work OK? I "private install"
would be great for me, if it works :D

Nov 3 '05 #9
Aquarius <st**********@g mail.com> wrote:
I want to know if there is a way to interface a MySQL database without
Python-MySQL or without installing anything that has C files that need
to be compiled. The reason for this, is that I want to develop a
certain web application, but my hosting provider (!#@$!@#%) isn't very
eager to supply Python-MySQL (or any modules to python). Is there an
alternative approach I could use to pass around this ridiculos lack of
functionalit y?


If you've got MySQL installed, you probably have a command-line
mysql client, and you could use subprocess or popen to run that.
That's a little desperate though, and the error handling will suck.
(I've seen this trick used with other databases.)

--
\S -- si***@chiark.gr eenend.org.uk -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the other"
\X/ | -- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
Nov 3 '05 #10

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

Similar topics

1
2199
by: Yong Wang | last post by:
Hi, All: We have a network management system written in C++, MysQL, and Hp SNMP. It works in Solaris command line. When I wrote a similar python codes which call compiled C++ and mysql codes in solaris command line, the comipled codes work fine in wraped python file. When I change the python codes to web interface in python CGI script, I got...
2
10266
by: francescomoi | last post by:
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
2
2067
by: Cathy Hui | last post by:
I am trying to install MySQL-Python 0.9.1 on my Solaris 8 system. The system has Python 2.3.3 and Mysql 4.0.21 installed. This is where I downloaded the distribution of the Mysql-python package: http://www.ravenbrook.com/project/p4dti/import/2001-10-16/MySQL-python-0.9.1/MySQL-python-0.9.1.tar.gz I have been doing whatever instructed...
2
2551
by: Cathy Hui | last post by:
Do u know why do i get the following message when trying to build the MySql-Python (1.2.0) on my Solaris 8 system? (with mysql 4.0.21 and python 2.4). thanks! error mesg: ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1
10
3268
by: callmebill | last post by:
I'm getting my feet wet with making Python talk to MySQL via ODBC. I started on Windows, and it went smoothly enough due to the ODBC stuff that apparently is native to Python at least on windows (I've been following ch. 13 of Mark Hammond's py on win32 book). But now I'm trying to do equivalent stuff on linux (Fedora Core 3) with python...
2
1436
by: Richard Brosnahan | last post by:
I hate asking questions that have probably been answered before, but I have not found a way to conveniently search the archives of this mailing list. So... Can someone tell me how to search this mailing list, short of downloading every month's archive and searching manually? Or, can someone tell me how to easily interface with...
16
2442
by: bobrik | last post by:
Hello, I am using the Python DB API for access to MySQL. But it is not platform-independent - I need a module not included in Python by default - python-mysql, and it uses a compiled binary _mysql.so. So it is not platform-independent because for each web-server on different platform, I would have to download it and extra compile it...
113
5213
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. ...
13
2145
by: Steven Bethard | last post by:
Jean-Paul Calderone <exarkun@divmod.comwrote: Interesting. Could you give a few illustrations of this? (I didn't run into the same problem at all, so I'm curious.) Steve
1
3003
by: Steve Ametjan | last post by:
I've been trying to get MySQL-python to install on Leopard for the past couple of days, and I keep running into relatively the same error. I'm hoping that someone on this list will be able to help me out in solving the issue. I'd like to get this solved so I can continue developing with Django using MySQL since that's what my web ...
0
7710
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...
0
8092
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...
0
6437
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...
0
5296
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...
0
3738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3745
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2230
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1051
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...

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.