I have a written a very small web-based survey using cgi with python(This is my first web app. ).The questions are extracted from a MySQL database table and the results are supposed to be saved in the same database. I have created the database along with its table locally. My app works fine on my local computer(localhost). To create db,table and other transaction with the MySQL i had to do import MySQLdb in my code.
Now I want to upload everything on my personal hosting. As far as I know my hosting supports Python,CGI and has MySQL database. And I know that I have to change some parameters in the connection string in my code, so I can connect to the database, but I have two problems:
- I remember that I installed
MySQLdbas an extra to my Python, and in my code i am using it, how would I know that my hosting’s python interpretor has this installed, or do I even need it, do I have to use another library? - How do I upload my database onto my hosting?
Thanks
If you have shell access, you can fire up the python interpreter by running
pythonand typeimport MySQLdbat the>>>prompt. If you get no errors in return, then its installed.Likewise, if you have shell access, this page will help you with importing and exporting using the mysql command. I found it by googleing “import export mysql”.