Skip to main content
Bumped by Community user
added 415 characters in body
Source Link

I am trying to retrieve my data from MySQL to be used in python. But it prints out TypeError: 'NoneType' object is not iterable The server log shows that Access denied for user 'root'@'localhost' (using password: NO) This is the server log . Thanks in advance!

Edit: This is the python code

import pandas as pd

user, pw, host, db = 'root', '12345', '127.0.0.1', 'ca2database'
cnx = mysql.connector.connect(user=user, password=pw, host=host, database=db)
cursor = cnx.cursor()
df= pd.read_sql('SELECT * FROM student', con=cnx)
print(df)

cursor.close()
cnx.close()

and this is the data in the sql

I am trying to retrieve my data from MySQL to be used in python. But it prints out TypeError: 'NoneType' object is not iterable The server log shows that Access denied for user 'root'@'localhost' (using password: NO) This is the server log . Thanks in advance!

I am trying to retrieve my data from MySQL to be used in python. But it prints out TypeError: 'NoneType' object is not iterable The server log shows that Access denied for user 'root'@'localhost' (using password: NO) This is the server log . Thanks in advance!

Edit: This is the python code

import pandas as pd

user, pw, host, db = 'root', '12345', '127.0.0.1', 'ca2database'
cnx = mysql.connector.connect(user=user, password=pw, host=host, database=db)
cursor = cnx.cursor()
df= pd.read_sql('SELECT * FROM student', con=cnx)
print(df)

cursor.close()
cnx.close()

and this is the data in the sql

Source Link

MySql error: Access denied for user 'root'@'localhost' (using password: NO)

I am trying to retrieve my data from MySQL to be used in python. But it prints out TypeError: 'NoneType' object is not iterable The server log shows that Access denied for user 'root'@'localhost' (using password: NO) This is the server log . Thanks in advance!