where do you run database scripts/where are DBs 'located'?

John Salerno johnjsal at NOSPAMgmail.com
Fri May 12 10:01:51 EDT 2006


Ok, I've been browsing through the MySQLdb docs, and I *think* I know 
the kind of code I need to write (connect, cursor, manipulate data, 
commmit, etc. -- although I probably need to get more familiar with 
actual SQL commands too), but here's my problem: I don't know where 
these scripts are supposed to be executed, or how they are supposed to 
'find' the database.

Really, I have the same question for two different scenarios: accessing 
and working with a database that is stored locally on my PC, and the 
same with a DB that is on my web server space. I figure I already know 
the host, username, password and database name (in fact, all these 
things are spelled out as far as my web DB is concerned; I assume my 
host name for the local DB is my computer's name).

But my question is, can these DB scripts be executed anywhere, and they 
will find the DB based on the connect() parameters? Or do I need to do 
something special with them? It seems like a similar problem to when you 
don't have your PYTHONPATH variable set up properly. I've tried some DB 
stuff, but it doesn't seem to work.

If more information is needed, I will try my local DB when I get home 
later. As for the web DB, I figure there's probably more issues involved 
that I'm not aware of, since web programming is still new to me.

So without actually giving you some code and tracebacks, is there any 
general advice about how to set up these scripts? Also, is there any 
better documentation than this:
http://sourceforge.net/docman/display_doc.php?docid=32071&group_id=22307

It doesn't seem too thorough, and it also doesn't cover actual SQL 
queries that you'd have to pass to the query method. Maybe I will just 
have to find that information in a MySQL tutorial.

Thanks.



More information about the Python-list mailing list