# HG changeset patch # User catherine@dellzilla # Date 1265059933 18000 # Node ID da332a67037818650901ab28115d1d5353ad5542 # Parent e1a962dd7139b9eebe86159ca6448c565428b34e successful connect to mysql testdb diff -r e1a962dd7139 -r da332a670378 sqlpython/connections.py --- a/sqlpython/connections.py Mon Feb 01 15:56:15 2010 -0500 +++ b/sqlpython/connections.py Mon Feb 01 16:32:13 2010 -0500 @@ -111,7 +111,7 @@ pass self.set_corrections() if not self.password: - self.password = getpass.getpass() + self.password = getpass.getpass() def parse_connect_uri(self, uri): results = self.connection_uri_parser.search(uri) if results: @@ -149,6 +149,7 @@ def set_defaults(self): self.port = self.default_port self.hostname = 'localhost' + self.database = os.getenv('USER') def connection(self): return MySQLdb.connect(host = self.hostname, user = self.username, passwd = self.password, db = self.database, @@ -161,6 +162,7 @@ self.port = os.getenv('PGPORT') or self.default_port self.database = os.getenv('ORACLE_SID') self.hostname = os.getenv('PGHOST') or 'localhost' + self.username = os.getenv('USER') def connection(self): return psycopg2.connect(host = self.hostname, user = self.username, password = self.password, database = self.database,