Answer the question
In order to leave comments, you need to log in
How to migrate tables from homestead laravel?
I'm trying to make a database migration a command
php artisan migrate
, but it gives me an error connecting to the database. The migration file itself is on the host machine, and I'm trying to execute the command by connecting to the homestead virtual machine with the command
vagrant ssh
Here is the text of the
Illuminate\Database\QueryException error itself: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' ( using password: NO) (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
at /home/vagrant/laravel/vendor/laravel/framework/src/Illuminate/Database/ Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
> 669| throw new QueryException(
670| $query, $this->prepareBindings($bindings), $e
671| );
672| }
673|
Answer the question
In order to leave comments, you need to log in
You are using homestead, and most likely you are trying to run "php artisan migrate" locally, but you need to do it from homestead, in the same place where you do "vagrant up", you need to do "vagrant ssh" and run artisan migrate already inside the virtual machine ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question