Skip to content

Commit 62ddd30

Browse files
authored
update remnants of passwd and db also in docs (#488)
1 parent 355520d commit 62ddd30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: doc/user_guide.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,27 @@ We haven't even begun to touch upon all the parameters ``connect()``
125125
can take. For this reason, I prefer to use keyword parameters::
126126

127127
db=_mysql.connect(host="localhost",user="joebob",
128-
passwd="moonpie",db="thangs")
128+
password="moonpie",database="thangs")
129129

130130
This does exactly what the last example did, but is arguably easier to
131131
read. But since the default host is "localhost", and if your login
132132
name really was "joebob", you could shorten it to this::
133133

134-
db=_mysql.connect(passwd="moonpie",db="thangs")
134+
db=_mysql.connect(password="moonpie",database="thangs")
135135

136136
UNIX sockets and named pipes don't work over a network, so if you
137137
specify a host other than localhost, TCP will be used, and you can
138138
specify an odd port if you need to (the default port is 3306)::
139139

140-
db=_mysql.connect(host="outhouse",port=3307,passwd="moonpie",db="thangs")
140+
db=_mysql.connect(host="outhouse",port=3307,password="moonpie",database="thangs")
141141

142142
If you really had to, you could connect to the local host with TCP by
143143
specifying the full host name, or 127.0.0.1.
144144

145145
Generally speaking, putting passwords in your code is not such a good
146146
idea::
147147

148-
db=_mysql.connect(host="outhouse",db="thangs",read_default_file="~/.my.cnf")
148+
db=_mysql.connect(host="outhouse",database="thangs",read_default_file="~/.my.cnf")
149149

150150
This does what the previous example does, but gets the username and
151151
password and other parameters from ~/.my.cnf (UNIX-like systems). Read
@@ -561,7 +561,7 @@ Some examples
561561
The ``connect()`` method works nearly the same as with `MySQLDB._mysql`_::
562562

563563
import MySQLdb
564-
db=MySQLdb.connect(passwd="moonpie",db="thangs")
564+
db=MySQLdb.connect(password="moonpie",database="thangs")
565565

566566
To perform a query, you first need a cursor, and then you can execute
567567
queries on it::

0 commit comments

Comments
 (0)