Python and also MySQL

I can get Python to collaborate with Postgresql yet I can not get it to collaborate with MySQL. The major trouble is that on the common organizing account I have I do not have the capacity to install points such as Django or PySQL, I usually fall short when mounting them on my computer system so possibly it's excellent I can not install on the host.

I located bpgsql actually excellent due to the fact that it does not call for an install, it's a file that I can consider, read and afterwards call the features of. Does any person recognize of something similar to this for MySQL?

0
2019-05-05 00:33:37
Source Share
Answers: 4

You can attempt establishing your very own python installment making use of Virtual Python. Look into just how to arrangement Django utilizing it here. That was created a long period of time earlier, yet it demonstrates how I obtained MySQLdb arrangement without having origin accessibility or anything like it. As soon as you've obtained the essentials going, you can install any kind of python collection you desire.

0
2019-12-01 22:36:26
Source

I do not have any kind of experience with http://www.SiteGround.com as a host directly.

This is simply a hunch, yet it's usual for a common host to sustain Python and also MySQL with the MySQLdb component (as an example, GoDaddy does this). Attempt the adhering to CGI manuscript to see if MySQLdb is mounted.

#!/usr/bin/python

module_name = 'MySQLdb'
head = '''Content-Type: text/html

%s is ''' % module_name

try:
    __import__(module_name)
    print head + 'installed'
except ImportError:
    print head + 'not installed'
.
0
2019-05-08 05:09:17
Source

MySQLdb is what I have actually made use of prior to.

If you host is making use of Python variation 2.5 or greater, assistance for sqlite3 data sources is constructed in (sqlite permits you to have a relational data source that is merely a documents in your filesystem ). Yet caveat emptor, sqlite is not matched for manufacturing, so it might depend what you are attempting to do with it.

An additional alternative might be to call your host and also whine, or transform hosts. Truthfully nowadays, any kind of self valuing host that sustains python and also mysql should certainly have actually MySQLdb pre mounted.

0
2019-05-07 21:40:13
Source

I posted it and also obtained an inner mistake

Premature end of script headers
.

After much messing around, I located that if I had

import cgi
import cgitb; cgitb.enable()
import MySQLdb
.

It would certainly offer me a far more valuable solution and also claim that it was not mounted, you can see it on your own -> http://woarl.com/db.py

Oddly sufficient, this would certainly generate a mistake

import MySQLdb
import cgi
import cgitb; cgitb.enable()
.

I considered several of the various other documents I had up there and also it appears that collection was just one of the ones I had actually currently attempted.

0
2019-05-07 18:58:46
Source