cndBase = pyodbc.connect(
    'DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; PORT=3306;DATABASE=nameDBase; UID=root; PASSWORD=12345;'
    )
ptdBase = cndBase.cursor()
query_str = 'SELECT* FROM nameTabla;'
pyodbc and mySQL