carlos.ortiz....@gmail.com writes: > So I wrote my method like this: ... > cnxOMC = mysql.connector.connect(user, > password, > 'localhost', > database) ... > the following code executes nice and smooth: ... > cnxOMC = mysql.connector.connect(user="root", > password='PK17LP12r', > host='localhost', > database='TESTERS')
You pass the hardcoded parameters as keyword arguments, unlike in the version that doesn't work. Maybe that is the difference. Try this: cnxOMC = mysql.connector.connect(user=user, password=password, host='localhost', database=database) It only looks funny. In "user=user" the first "user" is a parameter name, the other is the variable in your code. Try help(mysql.connector.connect) at the interactive prompt, or otherwise check the documentation. -- https://mail.python.org/mailman/listinfo/python-list