Saifullah Anik
Saifullah Anik

Reputation: 1

Unable to connect MySQL (xampp) using Python

import mysql.connector

conn = mysql.connector.connect(host="localhost", user="root", password="")

if conn.is_connected():
    print("Successful")
else:
    print("Not Successful")`

I think my everything is ok in environment variable setup, mysql is also running in the system, python works properly, xampp also works well, the value of host, user are also correct. But I am unable to connect with Mysql using python. This is not even showing any error. There comes no output at all. Output Whenever I run the program, I get no output at all, I am pretty much sure the problem is happening in the second line. but not sure what is happening and how to solve.

I tried using Mysql workbench, doesn't work. I am expecting to control my database from this python program

Upvotes: 0

Views: 57

Answers (0)

Related Questions