Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'exist.': 0.09; 'to:addr:comp.lang.python': 0.09; 'wrong,': 0.09; 'cc:addr:python- list': 0.10; 'suggest': 0.11; '"unknown': 0.16; '"user': 0.16; "'test',": 0.16; 'wrote:': 0.17; 'file.': 0.20; 'trying': 0.21; 'import': 0.21; 'cc:2**0': 0.23; 'work.': 0.23; 'cc:no real name:2**0': 0.24; 'host': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.28; 'subject:: (': 0.29; "i'm": 0.29; "skip:' 10": 0.30; 'skip:_ 30': 0.32; 'knowledge': 0.33; 'code:': 0.33; 'received:google.com': 0.34; 'server': 0.35; 'list': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'data.': 0.36; 'xml': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'sure': 0.38; 'more': 0.63; 'subject:skip:_ 30': 0.84 Newsgroups: comp.lang.python Date: Wed, 15 Aug 2012 07:53:50 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=113.106.106.98; posting-account=gm5T0QoAAADsrQB6lKn4dmNQxJ9E7E9m References: <6a5212e3-4ff9-4cec-afe5-8b81e231eb67@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 113.106.106.98 MIME-Version: 1.0 Subject: Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host From: nepaul To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345042433 news.xs4all.nl 6926 [2001:888:2000:d::a6]:34413 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27100 =E5=9C=A8 2012=E5=B9=B48=E6=9C=8815=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89UTC+= 8=E4=B8=8B=E5=8D=8810=E6=97=B623=E5=88=8624=E7=A7=92=EF=BC=8CMark Lawrence= =E5=86=99=E9=81=93=EF=BC=9A > On 15/08/2012 14:30, nepaul wrote: >=20 > > The code: >=20 > > import MySQLDB >=20 > > strCmd =3D "user =3D 'root', passwd =3D '123456', db =3D 'test', host = =3D 'localhost'" >=20 > > >=20 > > _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host '= user =3D 'root', passwd =3D '123456', db =3D 'test', host =3D 'localhost'' = (11004)") >=20 > > >=20 >=20 >=20 > My highly paid team of consultants suggest that you're trying to connect= =20 >=20 > to a MySQL server host that doesn't exist. However I'm sure that people= =20 >=20 > on this list with more knowledge of MySQLDB than my consultants will be= =20 >=20 > able to give you more detailed data. >=20 >=20 >=20 > --=20 >=20 > Cheers. >=20 >=20 >=20 > Mark Lawrence. if i use MySQLdb.connect(strCmd) -> wrong, but if use MySQLdb.connect(user = =3D 'root', passwd =3D '123456', db =3D 'test', host =3D 'localhost'),it wo= rk. and the strCmd is read from a xml file.