Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions pysysinfo/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ def __init__(self, host=None, port=None,
self._conn = None
self._connParams = {}
if host is not None:
self._connParams['host'] = host
if port is not None:
self._connParams['port'] = port
if host[:1] == "/":
self._connParams['unix_socket'] = host
else:
self._connParams['port'] = defaultMySQLport
self._connParams['host'] = host
if port is not None:
self._connParams['port'] = port
else:
self._connParams['port'] = defaultMySQLport
elif port is not None:
self._connParams['host'] = '127.0.0.1'
self._connParams['port'] = port
Expand Down