473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Mysql in Python?

Hello,
i tried to find something about mysql in www.python.org, but found
nothing...
What can you recommend to use for getting and putting data from and into a
mysql database?
On my Suse 9.1 i found a rpm python-mysql. In the web i found the hk_classes
from www.knoda.org. This should do also such things.
Can you recommend something? What do you use?
Thank you very much for the info.
--
Grüsse/Greets
Stolz Stefan
Jul 18 '05 #1
4 1591
Stefan Stolz wrote:
Hello,
i tried to find something about mysql in www.python.org, but found
nothing...
What can you recommend to use for getting and putting data from and into a
mysql database?
On my Suse 9.1 i found a rpm python-mysql. In the web i found the hk_classes
from www.knoda.org. This should do also such things.
Can you recommend something? What do you use?
Thank you very much for the info.

I have used a MySQLdb module before. Here's a piece of code that I
found lying around my home directory:

import MySQLdb

if __name__ == "__main__":
db_conn =
MySQLdb.connect(host='hostname',db='database_name' ,user='username',passwd='password')
handle = db_conn.cursor()
query = "SELECT * FROM foo"
handle.execute(query)
Results = handle.fetchall()
print Results

I'm not sure, but I believe that MySQLdb is included in this project:

http://sourceforge.net/projects/mysql-python

(which appears to have been updated only a couple of months back, so
that's good news).
Jul 18 '05 #2
Jeremy Jones wrote:
I'm not sure, but I believe that MySQLdb is included in this project:

http://sourceforge.net/projects/mysql-python

(which appears to have been updated only a couple of months back, so
that's good news).

Thank you, but i don`t understand why there is nothing implemented in
Python?

I was a little konfused after reading the doku of mysql-python, because
there the author says its better to use MySQLdb ;-) ?!?!
--
Grüsse
Stolz Stefan
Jul 18 '05 #3
Stefan Stolz wrote:
Jeremy Jones wrote:
I'm not sure, but I believe that MySQLdb is included in this project:

http://sourceforge.net/projects/mysql-python

(which appears to have been updated only a couple of months back, so
that's good news).

Thank you, but i don`t understand why there is nothing implemented in
Python?

I was a little konfused after reading the doku of mysql-python, because
there the author says its better to use MySQLdb ;-) ?!?!

So, are you wanting a pure Python module to connect to MySQL? I'm not
sure there are any that exist.

Jeremy
Jul 18 '05 #4
Jeremy Jones wrote:
I was a little konfused after reading the doku of mysql-python, because
there the author says its better to use MySQLdb ;-) ?!?!

So, are you wanting a pure Python module to connect to MySQL? I'm not
sure there are any that exist.

10 seconds with google and maybe some leads:
http://www.hk8.org/old_web/linux/sql/ch11_01.htm
http://mysql.mirror.nedlinux.nl/downloads/python.html
http://linux.maruhn.com/sec/mysql-python.html
http://linux.com.hk/docs/mysql/manua...s.html#IDX2125

HTH.

--
Yann.K
Jul 18 '05 #5

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

Similar topics

1
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...
1
by: Dave Ekhaus | last post by:
hi my news carrier didn't have any mysql specific news groups - so apologize in advance if this isn't exactly the proper group for these question(s) ... anyway - i'm trying to figure out how...
2
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...
2
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...
2
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:...
0
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
2
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...
1
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...
3
by: marexposed | last post by:
I've got this error (see the path in last line) db=MySQLdb.connect(host='localhost',use_unicode = True, charset = "Windows-1251",user='root',passwd='12',db='articulos') File...
0
by: Edwin.Madari | last post by:
-----Original Message----- statement prepared first and executed many times with exectemany - db API http://www.python.org/dev/peps/pep-0249/ inline statemets can be exeucuted only. hope that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.