I am curently developping a python discord bot using a mysql database for the storage of informations. When I'm testing, I often have a lot of little bugs so I quickly resolve a bug, restart the programm to see the bugs that are left, solve one again. I work a bit like that and sometimes for no particular reason, the connection to the database would just not work. If I wait someting like 3-4 minutes it eventually rework again. It's a bit annoying because it slow me down a lot. This issue seems like there is a cooldown or something that I am not aware of and this is why I'm asking here. Is there something like that and is it possible to disable it ?
This is the code I use to establish the connection :
cnx = mysql.connector.connect(
user=config.user,
password=config.word,
host=config.ip,
database='database_name')
cnx.autocommit = True
I use the library mysql connector
Note : The account I'm connecting with to the database is the root account so there should be no limitations. Other note : My connection is a local connection. The database is hosted on my computer
This is the error I get :
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'root'@'192.168.0.105' (using password: YES)
The solution of @snakecharmerb worked for me. I had to replace the ip adress of my computer with "localhost" to counter any firewalls or network related problems. Thank's again !