2

I have my .env file configured with the remote DB credentials and its working on my local computer.

When I deploy the app to our dev server in the same page returns

SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from `table_companies`)

Is there a command that I'm missing? Why if my .env us using our cloudways database credentials is saying homestead'@'localhost?

Blue
  • 22,608
  • 7
  • 62
  • 92
kangular
  • 263
  • 4
  • 16

1 Answers1

1

The production server has its own DB credentials that you should put in server's own .env file.

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
  • Thank you for the quick response. How can I update the .env file in the server? Via FTP? – kangular Jan 24 '18 at 14:57
  • How did you get the rest of the files on the server? You should be able to use this method to edit the files also. – milo526 Jan 24 '18 at 14:58
  • @kangular if you don't use a tool like Laravel Forge, then you can edit that file via SFTP or SSH. – Alexey Mezenin Jan 24 '18 at 14:58
  • We used Cloudways and the is a feature to deploy via GIT. Tried to ad .env or modify/rename .env.example via SFTP but it fails. What permissions are recommended for this file? – kangular Jan 24 '18 at 15:10
  • What error does it show? Try to edit the file with `sudo`. – Alexey Mezenin Jan 24 '18 at 15:20
  • 1
    It was something to do with Cloudways, I contacted their customer support and they helped me reset permission to the directory to allow me to create the .env file. Thank you for help. – kangular Jan 24 '18 at 17:04