+ Reply to Thread
Results 1 to 3 of 3

Thread: python and mysql

  1. #1
    traficou is offline x10Hosting Member traficou is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    1

    python and mysql

    Hello,

    I'm interested in using pyhton scripts storing results in the mysql db. I have searched information about the mysqldb python module and it seems is not installed.

    I've tried to import the module and it's confirmed.

    Do you know if it is possible to install manually or include in the directory to import it?

    Is there any other possibility to connect python with postgree db?
    I don't want to use plain data files!!!!! xD

    Thank you all.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: python and mysql

    It's certainly possible to install manually. The trick is finding a binary distribution of MySQLdb that works on your server. The official build of 1.2.3rc1 is for 32 bit processors, and the servers are 64 bit. Well, Lotus is, but the others should be as well.

    Should you find or build a 64 bit Linux binary, install it to ~/lib/python. If it's in .egg format, rename the extension to .zip and extract the contents. Insert the following near the top of any script that needs to import a package in ~/lib/python:
    Code:
    import sys, os;
    
    homelibdir = os.path.join(os.path.expanduser('~'), 'lib', 'python')
    if homelibdir not in sys.path:
        sys.path.append(homelibdir)
    Normally, I'd say to put the above in ~/.pythonrc.py and put "import user" into the scripts, but the import fails for me on Lotus.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    arunproff is offline x10Hosting Member arunproff is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    9

    Re: python and mysql

    For postgresql I would recommend psycopg2 - a postgresql library for python.

    A 3rd alternative and one that is available as a built in module in python2.5+ is sqlite. Sqlite is a fairly robust lightweight SQL engine, while it does not have all the features of mysql or postgresql, it contains most of the commonly used functionality of sql databases. It is also fairly robust and fast.

    http://docs.python.org/library/sqlite3.html

+ Reply to Thread

Similar Threads

  1. Python and MySql
    By fulviodan in forum Programming Help
    Replies: 0
    Last Post: 05-31-2009, 10:10 AM
  2. Python Setup
    By nilamo in forum Free Hosting
    Replies: 5
    Last Post: 10-27-2007, 02:22 PM
  3. Python/.htaccess help
    By *Face in forum Free Hosting
    Replies: 6
    Last Post: 09-21-2007, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers