1

I'm trying cloudways as server to deploy my Laravel application on it. Everythings seems to work, except that I can't connect to Database. When I try to authenticate, I get this error :

SQLSTATE[HY000] [2003] Can't connect to MySQL server on '***.***.**.***' (4)

There is my .env files :

DB_HOST=localhost
DB_DATABASE=ynjrzmznup
DB_USERNAME=ynjrzmznup
DB_PASSWORD=**********

I tried to reach it using terminal :

$ mysql -u ynjrzmznup -h localhost -p

And i got this:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2562
Server version: 5.5.46-0+deb7u1 (Debian)

Everything work on my local environment. I can reach every public files on the server, but when I try to authenticate, I can't because the server is unable to get data from MySQL.

Moyed Ansari
  • 8,436
  • 2
  • 36
  • 57
Elie Morin
  • 1,456
  • 3
  • 15
  • 35

0 Answers0