Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php artisan migrate stuck at the beginning of the command

[MacOS 10.14.0] When I create a new project (Laravel new blog) Then create a table in MySQL (create database blog) And then update my .env file with the correct userame, password and database.

After creating a project, I will run php artisan migrate But my terminal stays empty, I can type in my terminal. But it won't do anything.

My storage/logs folder is empty.

I have 2 default migrate files in my database/migrations folder.

php migrate list works

What can it be?

like image 886
UNTITLED.PNG Avatar asked Dec 16 '25 11:12

UNTITLED.PNG


2 Answers

For me it helped just to restart local database.

like image 165
Pauls Bebris Avatar answered Dec 19 '25 06:12

Pauls Bebris


After a lot of trial and error, I found out that there was something wrong with my MySQL server. I reinstalled MySQL with brew. The latest version of 8 and the latest version of 5.7.*. Both didn't work, because of the following conflict: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found.

So the whole time, everything in my .env file was correct but my MySQL was broken. I also confirmed that by trying to connect with the app 'Sequel Pro'. And as I thought, it gave me the same conflict.

How I fixed the problem:

  • Remove all MySQL/MariaDB packages via brew (if you have installed them with brew like me)
  • Install MySQL Community Server 5.7.* from the official mysql.com website (you can google that file).
  • Add MySQL to your path export PATH=$PATH:/usr/local/mysql/bin
  • Go to: System Preferences -> MySQL -> press 'Start MySQL Server'
  • Change your temporary password with a new one mysqladmin -uroot -p[temporary password] password '[new password]'

Good luck! 👍


EDIT FEBRUARY 26 2019:
I found a problem with changing the random generated password. I was using MySQL Community Server 5.7.25 and the random generated password was: _>9mxWc9a!0.. When I was trying to change the default password with the command above. I was given the following error:
-bash: !0: event not found
If you have the same error as I did or something similar, try the following:

  • Enter the following command in your terminal: mysqladmin -uroot -p password '[new password]'
  • When you press enter, it will ask you for a password. Now enter the random generated password that was given to you by the MySql Community Server at installation in a prompt.

It should be working now! 😊

like image 25
UNTITLED.PNG Avatar answered Dec 19 '25 07:12

UNTITLED.PNG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!