1

I have a project on local host (xampp) and I want o connect database on server (hostinger.com) with this project, but I don't know? Can anyone help me? Thank so much.

my .env

Mr D
  • 63
  • 1
  • 2
  • 13

1 Answers1

0
Please use it may be working. Put value DB_DATABASE,DB_USERNAME & DB_PASSWORD see below.

APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://hostinger.com/
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= your database name here
DB_USERNAME= your database username here
DB_PASSWORD= your database password here

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Md.Jewel Mia
  • 3,345
  • 3
  • 19
  • 24
  • I did this but it still not working. And here is error from page SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. – Mr D Dec 19 '16 at 09:46
  • Please flow it. Laravel 4: Change "host" in the app/config/database.php file from "localhost" to "127.0.0.1" Laravel 5: Change "DB_HOST" in the .env file from "localhost" to "127.0.0.1" – Md.Jewel Mia Dec 19 '16 at 09:49
  • 1
    Please see link http://stackoverflow.com/questions/20723803/pdoexception-sqlstatehy000-2002-no-such-file-or-directory – Md.Jewel Mia Dec 19 '16 at 09:52
  • Thanks you so much. Your link is useful with me. – Mr D Dec 19 '16 at 10:00