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)")