I made a small project in laravel using MAMP, and everything works fine.
Now I'd like to put the project online. I copied the project with FTP and changed the database.php file.
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'private.be.mysql'),
'database' => env('DB_DATABASE', 'private_be'),
'username' => env('DB_USERNAME', 'private_be'),
'password' => env('DB_PASSWORD', 'private'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
The installation works fine when visiting the website, but when visiting a page that uses a connection to the database I get following error.
SQLSTATE[42S02]: Base table or view not found:
1146 Table 'private_be.users' doesn't exist (SQL: select * from `users`)
So I found out I had forgot to migrate my project. But when typing the command 'php artisan migrate' I get the following error in terminal.
[ErrorException]
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: nodename
nor servname provided, or not known
At first I thought maybe my settings for 'mysql' were incorrect, but I'm sure they are.
My .env file looks like this
APP_ENV=local
APP_DEBUG=true
APP_KEY=***
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Anybody who can help me fixing the migrate error?