468,507 Members | 1,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,507 developers. It's quick & easy.

mysql bulk insert from python

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 to perform a bulk insert of data
from a text file into a table in a mysql database from the python
programming language. i have lots of experience with ms sql server and
there we used bcp and then dts packages, but i can't seem to find the
analogous method for mysql - and would appreciate any tips/insight the
group can offer.

fwiw - the data files contain on the order of 100,000 + records
(sometimes approx. 1 million), so anything but a 'bulk' solution
probably isn't practical.

also - i found some reference to a 'Loader' python module, but it
seems to related to MaxDB and SAP. i'm not sure what that is - and
would really prefer a more generic solution.

thanks
dave

Jul 18 '05 #1
1 6342
Dave Ekhaus wrote:
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 to perform a bulk insert of
data from a text file into a table in a mysql database from the python
programming language. i have lots of experience with ms sql server and
there we used bcp and then dts packages, but i can't seem to find the
analogous method for mysql - and would appreciate any tips/insight the
group can offer.

fwiw - the data files contain on the order of 100,000 + records
(sometimes approx. 1 million), so anything but a 'bulk' solution
probably isn't practical.

also - i found some reference to a 'Loader' python module, but it
seems to related to MaxDB and SAP. i'm not sure what that is - and
would really prefer a more generic solution.

thanks
dave

The MySQL command LOAD DATA INFILE
(http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html) might be what you are
looking for, no need for python here, but you can call this command from
any python script that uses the MySQLDB module
(http://sourceforge.net/projects/mysql-python)
HTH,
Wolfram

PS: Maybe news.gmane.org has some mysql-lists that you can try
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by duikboot | last post: by
11 posts views Thread by grumfish | last post: by
2 posts views Thread by php newbie | last post: by
6 posts views Thread by pk | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
1 post views Thread by The|Godfather | last post: by
1 post views Thread by Ike | last post: by
3 posts views Thread by gieforce | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.