skip to Main Content

I created my first App, using Laravel in the Backend. Everything was running on my localhost and I deployed everything to my Netcup Webhosting Server.

I run composer install successfully, generated the API key by using php artisan key:generate --ansi and set up my .env file. The File looks like:

APP_NAME="App Name"
APP_ENV=prod
APP_KEY=base64_key
APP_DEBUG=false
APP_URL=https://xx.xxxxx.de

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME="db_user"
DB_PASSWORD="db_user_password"

The I want to create all the database tables by using php artisan migrate. I tripple checked the values set in the .env and red a lot of solutions of other posts, but nothing worked. I keep getting the following error:

enter image description here

I already added quotes to DB_User and Pasword in .env file. I restarted the server several times and cleaned the cache.

2

Answers


  1. Chosen as BEST ANSWER

    Solved the issue:

    As @N69S correctly suggested it was related to Netcup. For any other Netcup user the following solution. Netcup devides its Webhosting and Database. Therefore you need to put you Database IP into your .env file. That can be found in the connection data.


  2. It looks like some problems with auth on the Netcup Web hosting Server. Can you check list of user with access to db_name? Besides, by screenshoot I guessing that hosting add prefix ("k177581_") for db_name and db_user

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search