我正在使用 laravel socialite 进行 facebook 登录,关注这个网站:Social Logins with Socialite
当我在终端中输入命令时:
php artisan migrate
这显示了错误:
Illuminate\Database\QueryException : SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
最佳答案
打开.env
文件并编辑它。只需设置正确的数据库凭据:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= // Your Database Name
DB_USERNAME= // Your Database Username
DB_PASSWORD= // Your Database Password
如果您没有默认用户名,则DB_USERNAME
应设置为root
如果没有在数据库上设置密码,清除它DB_PASSWORD
.env编辑完成后一定要清除缓存:php artisan config:cache
运行 migrate Artisan 命令后:php artisan migrate
关于php - 如何解决 laravel php artisan migrate 错误问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57770638/