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

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]>

Thanks in advance.

Any Feedback
Thanks in advance

How and where did you deploy Redash?

I deploy redash on my local vm for ubuntu-16.04.5-desktop-amd64
I follow the steps in https://redash.io/help/open-source/dev-guide/docker

Thanks in advance.

Any Feedback
Thanks in advance

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.

I can access remotely to MySQL server, but when i give same details into redash i’m not able to connect to the host.

Redash throws me an error:


and that’s not the host i’ trying to connect.
the host name has changed somehow.

@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.

Oh… that 162.244.80.136, that’s the address of your MySQL server?

Correct ! but the error says… it’s try to connect to “172.18.0.4” which is wrong.
Donno why though !

Ahhhh. I think you’re misreading the error.

My understanding, is that the error is showing the IP address the connection is coming from. Not the address it’s connecting to.

eg: “Hey, that IP address 172.18.0.4, has no permission to connect to this MySQL server.”

:wink:

were you able to solve this issue? since am too facing exact issue. Thanks.

What error message do you receive?