@@ -125,27 +125,27 @@ We haven't even begun to touch upon all the parameters ``connect()``
125125can 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
130130This does exactly what the last example did, but is arguably easier to
131131read. But since the default host is "localhost", and if your login
132132name 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
136136UNIX sockets and named pipes don't work over a network, so if you
137137specify a host other than localhost, TCP will be used, and you can
138138specify 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
142142If you really had to, you could connect to the local host with TCP by
143143specifying the full host name, or 127.0.0.1.
144144
145145Generally speaking, putting passwords in your code is not such a good
146146idea::
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
150150This does what the previous example does, but gets the username and
151151password and other parameters from ~/.my.cnf (UNIX-like systems). Read
@@ -561,7 +561,7 @@ Some examples
561561The ``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
566566To perform a query, you first need a cursor, and then you can execute
567567queries on it::
0 commit comments