Connect to a database located on phpmyadmin from python

Viewed 23

I'm looking to connect to a database via python. The database is on phpmyadmin.

I read the section "variable" on phpmyadmin and I saw that the hostname is "atexo-sourcing-prod-01.local-trust.com".

Unfortunately, when I try to connect with this python code and with the same login and password that I use to connect to phpmyadmnin:

try:
conn = mariadb.connect(
    user="mylogin",
    password="my_password",
    host="atexo-sourcing-prod-01.local-trust.com",
    port=3306,
    database="atexo_prod_sourcing_db")

except mariadb.Error as e:
    print(f"Error connecting to MariaDB Platform: {e}")

I have an error, saying

Can't connect to server on 'atexo-sourcing-prod-01.local-trust.com' (10061)

(I think it's not a problem of hostname, because when I put a random name, I have an other error).

Any idea to fix this?

0 Answers
Related