简体   繁体   中英

Laravel migrate not working on new database

I just uninstalled and installed back again MySQL via brew in Mac OS X High Sierra. I created back a db for my Laravel project, then made sure the name of the db matched the one in the .env, but when running:

php artisan migrate

nothing's happening. I tried also

php artisan migrate -vvv

but I've got the same result: nothing! No output, no errors indicating what might be wrong.

Any indication will be appreciated.

您可以使用以下常用的php artisan cache:clear清除缓存,然后可以使用php artisan migration尝试一下,希望对您有所帮助!

I had the same issue as you do and in my case I didn't had password set for db user which caused this issue. Try the following:

  • Assign password to the db user using mysqladmin -u YOURDBUSER password 'newpassword'
  • If it still doesn't work after assigning password to the user, try granting that user all permissions (I don't advise this for production use) GRANT ALL PRIVILEGES ON yourDB.* to 'YOURUSER'@'localhost';

Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM