Thread: Mypysql help

    #1
  1. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,285
    Rep Power
    13

    Question Mypysql help


    Because Python 3 doesnt support MySQLdb moudle yet i decided to use mypysql-0.5.5.tar.gz which i found in google.

    problem is that i dont know how to run this file in my webost account so it cant be utilized and so i can pass to Python 3 at last.

    i ahve uplaoded the file viua cPnael in webhost but then what?

    How doi "embed" this in python so to make use of it?
    What is now proved was once only imagined!
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    summary: learn how to build mypysql on similar local system, write a script to build mypysql on the remote system, then submit the script to the batch queue on the remote system.

    I'd find a local computer with the same operating system and hardware as your remote computer has. Then I'd build this mypysql on the local computer, writing down the correct steps.
    Convert the recipe into a shell script for your command line interpreter, then, after correcting the path names, submit the job to the batch queue on the remote host making sure that you get a copy of the error messages. If you don't have administrative privilege on the remote host take that into account before you start this messy process. Good luck!


    I think the alternative "build locally, copy all the changes to the remote host" is more difficult just because I wouldn't know how to identify all the changes. And the systems might have subtle differences that lead to terrible failure.


    Then again, this answer could be entirely off track.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,285
    Rep Power
    13
    Are you sure i need all there procedures which i have no idea on hpw to implement instread of just import somehting?

    I mean do i really need it? is there a way to use MySQLdb with Python 3 because all my python cgi scripts utilize MySQLdb ?
    What is now proved was once only imagined!
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    I'm not sure you need to do all that. Search the internet for more

    MySQLdb python3 yourOperatingSystem


    ...

    I tried to install from mypysql-0.5.5.tar.gz on my computer. If you have all the prerequisite files, and if the host system is linux, it's as easy as

    <copy mypysql-0.5.5.tar.gz onto remote system>
    <change directory to where you put it>

    tar xpzf mypysql-0.5.5.tar.gz
    cd mypysql-0.5.5
    sudo python3 ./setup.py install


    I don't think sudo will work in a batch script---I don't know how to insert the root password. (I'd submit the job as root user.) And the installation failed because of a missing header file:

    gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/usr/include/python3.2mu -c _mysql.c -o build/temp.linux-x86_64-3.2/_mysql.o
    _mysql.c:24:25: fatal error: mysql/mysql.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1


    I gave up. Had I persisted I would have next installed the mysql-developer package, if such a thing exists, which I presume it does.
    Last edited by b49P23TIvg; March 26th, 2013 at 10:57 AM.
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,285
    Rep Power
    13
    nikos@superhost.gr [~/www/mypysql-0.5.5]# sudo python3 ./setup.py install
    sudo: unable to mkdir /var/db/sudo: No such file or directory

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

    [sudo] password for nikos:
    nikos is not in the sudoers file. This incident will be reported.
    nikos@superhost.gr [~/www/mypysql-0.5.5]#
    What is now proved was once only imagined!
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    You've got a unix system. If the system manager contacts you ask that person to install the code for you.

    Otherwise, figure out how to install the code for single-user use only and you won't need the "do as superuser" command sudo.

    http://xkcd.com/149/
    [code]Code tags[/code] are essential for python code and Makefiles!
  12. #7
  13. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,285
    Rep Power
    13
    This is my hostgator reseller account and i already concted support to install it for me. i hope they will agree.
    What is now proved was once only imagined!

IMN logo majestic logo threadwatch logo seochat tools logo