REDASH While configure new data source for MySQL get error :
Connection Test Failed:
Can’t connect to MySQL server on ‘127.0.0.1’ (111)
While I connect with same parameters with MySQL Workbench
sudo netstat -ntlup | grep mysql
[sudo] password for frappe:
tcp6 0 0 :::3306 :::* LISTEN 1447/mysqld
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
frappe@ubuntu:~$ mysql -uroot -proot -hlocalhost
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.2.20-MariaDB-10.2.20+maria~xenial-log mariadb.org binary distribution
The Docker containers run in a different network, so you can’t just use localhost to access a database running on the host machine. You need to reference it with the IP address assigned to the host machine in the Docker network. Also need to make sure that MySQL listens on this address.
@hambira Do you have Admin access to your MySQL server?
Asking because if you do, this will be solve-able.
The problem here looks like a fairly simple permission/authentication problem.
When your Redash setup attempts to connect to MySQL, it’s doing so from (what seems like) the Docker network.
That network has a different set of IP addresses than your local workstation, so the MySQL server is effectively saying “Nope, never heard of you, go away”.
If you have Admin access to your MySQL server, you can update that to allow the connection from 172.18.0.4, which (from your screenshot) seems to be the address your Redash server was connecting from.
In theory, that should fix the problem.
On the other hand, if your Redash setup isn’t using Docker containers… then something else is happening, and the above may not be the correct solution. (!)
That’s not the host i have provided, it was " 162.244.80.136" in the host field of the data source form.
I have tried to access the mysql remotely and it works.
The problem right now is that the host i provided is different from what the redash is trying to connect.