_mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

Iuri iurisilvio at gmail.com
Wed Aug 15 11:06:34 EDT 2012


MySQLdb.connect does not accept a "connection string" parameter.

On Wed, Aug 15, 2012 at 11:53 AM, nepaul <xs.nepaul at gmail.com> wrote:

> 在 2012年8月15日星期三UTC+8下午10时23分24秒,Mark Lawrence写道:
> > On 15/08/2012 14:30, nepaul wrote:
> >
> > > The code:
> >
> > > import MySQLDB
> >
> > > strCmd = "user = 'root', passwd = '123456', db = 'test', host =
> 'localhost'"
> >
> > >
> >
> > > _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host
> 'user = 'root', passwd = '123456', db = 'test', host = 'localhost''
> (11004)")
> >
> > >
> >
> >
> >
> > My highly paid team of consultants suggest that you're trying to connect
> >
> > to a MySQL server host that doesn't exist.  However I'm sure that people
> >
> > on this list with more knowledge of MySQLDB than my consultants will be
> >
> > able to give you more detailed data.
> >
> >
> >
> > --
> >
> > Cheers.
> >
> >
> >
> > Mark Lawrence.
>
> if i use MySQLdb.connect(strCmd) -> wrong, but if use MySQLdb.connect(user
> = 'root', passwd = '123456', db = 'test', host = 'localhost'),it work. and
> the strCmd is read from a xml file.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120815/65490c10/attachment.html>


More information about the Python-list mailing list