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

2012-08-15 Thread nepaul
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)")


-- 
http://mail.python.org/mailman/listinfo/python-list


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

2012-08-15 Thread nepaul
在 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


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

2012-08-15 Thread nepaul
在 2012年8月15日星期三UTC+8下午11时22分49秒,Alain Ketterlin写道:
> Hans Mulder  writes:
> 
> 
> 
> > On 15/08/12 15:30:26, 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)")
> 
> >
> 
> > This message means that the MySQL connector cannot find 'localhost'.
> 
> 
> 
> No, it means that connect received a single string "user = 'root'..."
> 
> instead of a set of individual keyword parameters, and took the whole
> 
> string to be the name of the host (its first parameter). Of course,
> 
> there is no host with such a name.
> 
> 
> 
> The solution is to parse the string into individual values, and pass
> 
> these in the correct order.
> 
> 
> 
> -- Alain.

Yeah!Great!Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2012-08-15 Thread nepaul
在 2012年8月16日星期四UTC+8上午12时58分07秒,Dennis Lee Bieber写道:
> On Wed, 15 Aug 2012 17:22:49 +0200, Alain Ketterlin
> 
>  declaimed the following in
> 
> gmane.comp.python.general:
> 
> 
> 
> > Hans Mulder  writes:
> 
> > 
> 
Right!
> > > On 15/08/12 15:30:26, 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)")
> 
> > >
> 
> > > This message means that the MySQL connector cannot find 'localhost'.
> 
> > 
> 
> > No, it means that connect received a single string "user = 'root'..."
> 
> > instead of a set of individual keyword parameters, and took the whole
> 
> > string to be the name of the host (its first parameter). Of course,
> 
> > there is no host with such a name.
> 
> > 
> 
> > The solution is to parse the string into individual values, and pass
> 
> > these in the correct order.
> 
> 
> 
>   MySQLdb code itself recommends to always use keyword parameters, so
> 
> the order shouldn't be significant... (and when one sees the list of
> 
> optional keywords, using null commas to space positional arguments would
> 
> be insane)
> 
> 
> 
>   Parsing that string into separate fields (preferably a dictionary so
> 
> **conectitems could be used) OTOH is critical.
> 
> 
> 
> -- 
> 
>   Wulfraed Dennis Lee Bieber AF6VN
> 
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


sqlalchemy.exc.ProgrammingError: (ProgrammingError) ('42000', "[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]'f2f68'

2012-08-17 Thread nepaul
===case1==:
import sqlalchemy 
test1 = "631f2f68-8731-4561-889b-88ab1ae7c95a"
cmdTest1 = "select * from analyseresult where uid = " + test1
engine = 
sqlalchemy.create_engine("mssql+pyodbc://DumpResult:123456@localhost/DumpResult")
c = engine.execute(cmdTest1)
==case2===:
import sqlalchemy 
test2 = "123"
cmdTest2 = "select * from analyseresult where uid = " + test2
engine = 
sqlalchemy.create_engine("mssql+pyodbc://DumpResult:123456@localhost/DumpResult")
c = engine.execute(cmdTest1)


!
case1 :wrong,(sqlalchemy.exc.ProgrammingError: (ProgrammingError) ('42000', 
"[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]'f2f68') case2:work!
-- 
http://mail.python.org/mailman/listinfo/python-list


python game develop:framework?

2012-10-14 Thread nepaul
Something good framwork?
-- 
http://mail.python.org/mailman/listinfo/python-list


some godd python blog?

2012-10-22 Thread nepaul

-- 
http://mail.python.org/mailman/listinfo/python-list


What the diferences : web.py Tornado Twisted ?!

2012-11-02 Thread nepaul
What the diferences : web.py Tornado Twisted ?!
-- 
http://mail.python.org/mailman/listinfo/python-list


a better way to operate svn with python(better than pysvn)?

2014-05-12 Thread xs . nepaul

-- 
https://mail.python.org/mailman/listinfo/python-list