Laravel SQLSTATE[HY000] [2002] Connection refused

前端 未结 10 1376
情深已故
情深已故 2020-12-18 20:44

so I want to deploy my existing laravel porject into my digitalocean vps I user this tut and I upload my site successfully

also my env file is

APP_E         


        
10条回答
  •  北海茫月
    2020-12-18 21:25

    There are a few possibilities why your getting this error.

    • database server isn't started, check if you can still use your phpmyadmin. If you can still use it then nothing is wrong with your database server.
    • wrong config; check username, password and server settings in both your .env file and your config/database.php
    • no privileges to the server and or database with given credentials Looking at the steps you already took I think it's the last.

    Check to see if this user has access to the database from the remote location. By default the root user has access to the server locally (localhost,127.0.0.1 and ::1).

    So check to see if the user has access from either your remote ip or from anywhere.

    As you are using digitalocean I would suggest to check if they have a specific configuration to connect to mysql database.

提交回复
热议问题