Connecting via Python3 to MariaDB

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Connecting via Python3 to MariaDB

Postby lonesoac0 » 17. October 2017 23:26

Hello all,

I am trying to get my Python3 code to connect from one host to another that has MariaDB as the server. I am using the mysql.connector to facilitate the connection. The basic Python3 cod I am using is: user='username', password='password', database='database', host='192.168.1.120'. The host OS is Debian 9. My issue is that I keep getting the error code of:
Code: Select all
mysql.connector.errors.ProgrammingError: 1045 (28000): Access Denied for user 'username'@'192.168.1.67' (using password: YES)


In my Debian 9 MariaDB host, the file of: /etc/mysql/my.conf has been configured to allow for all workstations to allow for connections with the line of:
bind-address = 0.0.0.0


I also ran the commands of:
Code: Select all
grant all privileges on database.* to 'username'@'192.168.1.67' with grant option;

Code: Select all
flush privileges;


What. Am I missing?!
lonesoac0
 
Posts: 3
Joined: 17. October 2017 23:11
Operating System: Debian 9

Re: Connecting via Python3 to MariaDB

Postby Nobbie » 18. October 2017 11:37

lonesoac0 wrote:host='192.168.1.120'. The host OS is Debian 9. My issue is that I keep getting the error code of:
mysql.connector.errors.ProgrammingError: 1045 (28000): Access Denied for user 'username'@'192.168.1.67' (using password: YES)


Seems you are mixing up IPs...
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 22 guests