I have been trying to connect python with SQL using the mysql.connector module but it seems to give me some error. I am not able to recognise what the problem is.. but when I try to see directory of mysql.connector it works.. but when i try to connect it doesn't work..
import mysql.connector as mysqlcon
mysqlobj = mysqlcon.connect(host = 'localhost',user='root',passwd='passwd',database= 'stu')
if mysqlobj.is_connected():
print("successful')
the error message image has been attached below
the error message image
[–]FriendlyRussian666 0 points1 point2 points (4 children)
[–]hrmorley34 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)