Hi, Asrarahmed Kadri wrote: > could you try: > 'host'='localhost' > > I mean put all the parameters with quotes, I guess that might be a cause > of the error. > > conn = MySQLdb.connect ('host' = "localhost", 'user' = "testuser", > 'passwd'= "testpass", 'db' = "test") No, unfortunately the problem remains, but thanks anyway.
Warm Regards, Mário Gamito > > > On 1/31/07, *Mário Gamito* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > wrote: > > Hi, > > I have this code: > > import MySQLdb > > conn = MySQLdb.connect (host = "localhost", user = "testuser", > passwd = "testpass", db = "test") > cursor = conn.cursor () > cursor.execute ("SELECT VERSION()") > row = cursor.fetchone () > print "server version:", row[0] > cursor.close () > conn.close () > > that gives me the error: > "./mysql.py: line 3: syntax error near unexpected token `(' > ./mysql.py: line 3: ` conn = MySQLdb.connect (host = "localhost", > user > = "testuser", passwd = "testpass", db = "test")' > " > > Why is this ? > I can't imagine. > > Any help would be appreciated. > > Warm Regards, > Mário Gamito > _______________________________________________ > Tutor maillist - Tutor@python.org <mailto:Tutor@python.org> > http://mail.python.org/mailman/listinfo/tutor > > > > > -- > To HIM you shall return. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor