PedroFumero
3 months ago
703
3
Laravel

Connect with remote database on CPANEL?

Posted 3 months ago by PedroFumero

I've deploy an application on heroku, but I want to use a database hosted on a CPANEL. On env variables I fill:

DB_CONNECTION DB_HOST DB_PORT DB_DATABASE DB_USERNAME DB_PASSWORD

With my data, and when I try to run a migrations with: heroku run:detached php artisan migrate --force I receive the follow errors:

2020-03-24T17:37:52.841721+00:00 heroku[run.3073]: Starting process with command php artisan migrate --force 2020-03-24T17:37:53.574707+00:00 heroku[run.3073]: State changed from starting to up 2020-03-24T17:37:55.116793+00:00 heroku[run.3073]: State changed from up to complete 2020-03-24T17:37:55.040723+00:00 app[run.3073]: 2020-03-24T17:37:55.041174+00:00 app[run.3073]: In Connection.php line 664: 2020-03-24T17:37:55.041191+00:00 app[run.3073]: 2020-03-24T17:37:55.041194+00:00 app[run.3073]: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known (SQL: select * from information_schema.tables where table_schema = 2020-03-24T17:37:55.041195+00:00 app[run.3073]: esrr4dmc_donaciones_alesco and table_name = migrations) 2020-03-24T17:37:55.041215+00:00 app[run.3073]: 2020-03-24T17:37:55.041215+00:00 app[run.3073]: 2020-03-24T17:37:55.041364+00:00 app[run.3073]: In Connector.php line 70: 2020-03-24T17:37:55.041376+00:00 app[run.3073]: 2020-03-24T17:37:55.041380+00:00 app[run.3073]: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known 2020-03-24T17:37:55.041398+00:00 app[run.3073]: 2020-03-24T17:37:55.041398+00:00 app[run.3073]: 2020-03-24T17:37:55.041507+00:00 app[run.3073]: In Connector.php line 70: 2020-03-24T17:37:55.041525+00:00 app[run.3073]: 2020-03-24T17:37:55.041544+00:00 app[run.3073]: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known 2020-03-24T17:37:55.041547+00:00 app[run.3073]: 2020-03-24T17:37:55.041550+00:00 app[run.3073]: 2020-03-24T17:37:55.095664+00:00 heroku[run.3073]: Process exited with status 1

Someone can explain me what is my error please?

Please sign in or create an account to participate in this conversation.