mercredi 26 février 2020

Laravel using vagrant: php artisan migrate --seed giving errors

homestead version: 9.2.0 vagrant version: 2.2.7 php version: 7.2.21 mysql version: 8.0.18

I created a new laravel project. I created a database called tickets. I've added the third party code from https://github.com/creativetimofficial/material-dashboard-laravel. When I get to step where you run "php artisan migrate --seed" I'm getting two different errors depedning on how I set db port in .env file.

Here's a picture of my db users and their hosts.

enter image description here

when DB_HOST=127.0.0.1 and I run the artisan migrate I get an error saying Connection refused. I only tried using 127.0.0.1 because I saw online people saying to use this instead of localhost. Since the connection is refused I have a feeling this isn't correct.

When DB_HOST=localhost and I run artisan migrate I get an error saying

No such file or directory (SQL: select * from information_schema.tables where table_schema = tickets and table_name = migrations and table_type = 'BASE TABLE') {"exception":"[object] (Illuminate\\Database\\QueryException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = tickets and table_name = migrations and table_type = 'BASE TABLE') at /Applications/MAMP/htdocs/ticket-dashboard/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669)

Questions: 1) should I be using the IP instead of localhost and if so why do I get connection refused with using the IP? 2) If using localhost is fine, what needs to be fixed to bypass this error?

I've been testing everything I can find online to help, but this is the closest I've gotten. Any advice or ideas would be greatly appreciated



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire