I still do not know why but this method works:
import mysql.connector
cnx = mysql.connector.connect(user='scott', password='password',
host='127.0.0.1',
database='employees')
cnx.close()
But this method does not:
from mysql.connector import (connection)
cnx = connection.MySQLConnection(user='scott', password='password',
host='127.0.0.1',
database='employees')
cnx.close()
What puzzles me is that in the MYSQL Connector/Python developer guide it states that both work and that the first method is preferred, my luck of course.
Any ideas why, I would like to learn, fix and resolve.
Thanks,