File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class Pool(object):
43
43
:param port: Port of MySQL server
44
44
:param user: User of MySQL server
45
45
:param password: Password of MySQL server
46
+ :param unix_socket: Optionally, you can use a unix socket rather than TCP/IP.
46
47
:param db: Database of MySQL server
47
48
:param charset: Charset of MySQL server
48
49
:param cursorclass: Class of MySQL Cursor
@@ -62,6 +63,7 @@ def __init__(self,
62
63
port = 3306 ,
63
64
user = None ,
64
65
password = None ,
66
+ unix_socket = None ,
65
67
db = None ,
66
68
charset = "utf8" ,
67
69
cursorclass = pymysql .cursors .DictCursor ,
@@ -99,6 +101,8 @@ def __init__(self,
99
101
self .counter = 0
100
102
self .accumulation = 0
101
103
104
+ self .unix_socket = unix_socket
105
+
102
106
def create_conn (self ):
103
107
"""Create mysql connection by pymysql and to add unuse_list"""
104
108
c = pymysql .connect (
@@ -109,7 +113,8 @@ def create_conn(self):
109
113
db = self .db ,
110
114
charset = self .charset ,
111
115
cursorclass = self .cursorclass ,
112
- autocommit = self .autocommit
116
+ autocommit = self .autocommit ,
117
+ unix_socket = self .unix_socket
113
118
)
114
119
self .unuse_list .add (c )
115
120
You can’t perform that action at this time.
0 commit comments