'Error 2002 or 2013 when connecting to my MariaDB database on Cloud SQL
I´m experiencing some kind of network issue when connecting to my MariaDB remotely, which is hosted on a CloudSQL instance (nevertheless, I think that this is unrelated).
When I'm trying to connect through mysql.exe or mariadb.exe from my installation of mariaDB:
mysql.exe -h x.y.z.a -u test -p
mariadb.exe -h x.y.z.a -u test -p
I'm getting two different error types:
ERROR 2002 (HY000): Can't connect to server on '34.105.136.61' (10060)
< OR >
ERROR 2013 (HY000): Lost connection to the server at 'handshake: reading initial communication packet', system error: 0
Sometimes is the first one and in other cases the second one.
I understand that both errors can be caused due a network/firewall issue, but I already tried the following:
- Adding an exception to the executables on the Windows firewall
- Disabling Windows Defender
- Adding a firewall rule to allow all the traffic from all ports/source/destination
And I'm still getting the same errors.
Additionally, I also use DataGrip as IDE on the same computer, and from the IDE I'm able to connect correctly to the database, so it doesn´t seem to be caused by the server.
Any idea will be highly appreciated.
EDIT: when I use telnet telnet x.y.z.a 5432 I'm connecting correctly, so the port seems to be accesible
Solution 1:[1]
Cloud SQL supports MySQL, Postgres, and SQL Server engines, but not MariaDB.
Additionally, you tested telnet x.y.z.a 5432, but the port for Cloud SQL MySQL instances is 3306. (5432 is the port for Postgres).
You should verify which type of Cloud SQL instance you have created, and that you are using the right cli to connect with it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kurtisvg |
