[DB-SIG] DSN question
Glen Starchman
Gstarchman@urbanbrands.com
Mon, 14 Feb 2000 07:02:26 -0500
A file DSN is only applicable if you are using ODBC.
You want to do something like:
mysql.connect("127.0.0.1/username/password")
I do recommend, however, for both security and maintenance issues that you
place the connection string in an included file like:
#this is connect.py
CONNECT_STRING = "127.0.0.1/username/password"
#then, every file that needs to create a mysql connection would do...
import connect
mysql.connect(connect.CONNECT_STRING)
Bear in mind that I have not used the mysql module so the syntax of the
connect string might be slightly different. Check the docs!
;-)
********************************************
Glen Starchman
Director Of Web Technology
http://www.100percentgirls.com
917-402-0497
********************************************
-----Original Message-----
From: db-sig-admin@python.org [mailto:db-sig-admin@python.org]On Behalf
Of battery841@excite.com
Sent: Sunday, February 13, 2000 7:10 PM
To: db-sig@python.org
Subject: [DB-SIG] DSN question
I am writing a Python app which is using MySQL
(http://starship.python.net/crew/adustman/MySQLdb.html) on a Linux box to
talk to a mySQL database. A friend said I need (or at least should, I don't
remember) use DSN to get the host/login/password information. I don't
necessarily understand the concept of it. I am kind of new to Python and a
little lost on this. My friend said DSN uses an external file to read that
information. However, the MySQL docs seem like they want me to specify the
information in the mysql.connect() line. How do I go about doing this? I'd
be connecting to a local host. Would I put 127.0.0.1 or localhost? Can
someone give me a hand? I'm lost :) Thanks a lot
Kevin
_______________________________________________________
Get 100% FREE Internet Access powered by Excite
Visit http://freeworld.excite.com
_______________________________________________
DB-SIG maillist - DB-SIG@python.org
http://www.python.org/mailman/listinfo/db-sig