Question

configurar db DigitalOcean com um servidor Hostgator

Posted October 21, 2021 155 views
UbuntuMySQLUbuntu 18.04Databases

Olá estou tentando realizar o conexão remota entre um banco de dados digitalOcean e um site hospedado em outro servidor, informei o IP da hospedagem, configurei o banco para versão legada, criei usuário e senha mas a conexão só funciona na minha máquina, que foi configurada da mesma forma, no cliente (servidor Hostgator) dá erro na conexão 2002. como posso solucionar?
obs configurei ip da minha maquina e também da hospedagem ok

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi @tijacque,

The error (2002) Can’t connect to … normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.

https://dev.mysql.com/doc/refman/5.6/en/can-not-connect-to-server.html

I will suggest you check with Hostgator and see if there is any firewall blocking this droplet.

For information on Hostgator MySQL database connection issues:
https://www.hostgator.com/help/article/troubleshooting-mysql-database-connection-issues

I hope this helps!

Regards,
Rajkishore

  • Obrigada pelo retorno, é pode ser a questão no firewall pois na minha máquina usei os mesmos dados de conexão e estou conseguindo conectar normalmente.

  • olá Sabe me dizer, eu informei na conexão o arquivo ca-certificate.crt. Preciso informar alguma Key desse certificado? pq no Workbenck não informei nada e esta conectando. Se sim onde eu localizo esse key?

Hello, @tijacque

You can make sure that the database is running before doing another connection attempt from the 3rd party hosting provider.

Make sure to double check the database credentials and also verify that the external host can make outgoing connections on the specified port as well.

Hope that this helps!
Regards,
Alex