Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #27100

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

Newsgroups comp.lang.python
Date 2012-08-15 07:53 -0700
References <6a5212e3-4ff9-4cec-afe5-8b81e231eb67@googlegroups.com> <mailman.3312.1345040537.4697.python-list@python.org>
Subject Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host
From nepaul <xs.nepaul@gmail.com>
Message-ID <mailman.3315.1345042433.4697.python-list@python.org> (permalink)

Show all headers | View raw


在 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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

_mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host nepaul <xs.nepaul@gmail.com> - 2012-08-15 06:30 -0700
  Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-15 15:23 +0100
    Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host nepaul <xs.nepaul@gmail.com> - 2012-08-15 07:53 -0700
    Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host nepaul <xs.nepaul@gmail.com> - 2012-08-15 07:53 -0700
  Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host Hans Mulder <hansmu@xs4all.nl> - 2012-08-15 17:02 +0200
    Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-08-15 17:22 +0200
      Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host nepaul <xs.nepaul@gmail.com> - 2012-08-15 09:50 -0700
      Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-15 12:58 -0400
        Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host nepaul <xs.nepaul@gmail.com> - 2012-08-15 18:52 -0700
        Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host nepaul <xs.nepaul@gmail.com> - 2012-08-15 18:52 -0700

csiph-web