首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Laravel-8:php工匠迁移不工作

Laravel-8:php工匠迁移不工作
EN

Stack Overflow用户
提问于 2020-11-09 23:27:28
回答 1查看 2.7K关注 0票数 0

我尝试运行命令: php artisan migrate,但它给出了下面的错误。

错误:

代码语言:javascript
复制
   Illuminate\Database\QueryException 

  SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('mysql.infoschema'@'localhost') does not exist (SQL: select * from information_schema.tables where table_schema = test and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667▕         // If an exception occurs when attempting to run a query, we'll format the error
    668▕         // message to include the bindings with SQL, which will make this exception a
    669▕         // lot more helpful to the developer instead of just the database's errors.
    670▕         catch (Exception $e) {
  ➜ 671▕             throw new QueryException(
    672▕                 $query, $this->prepareBindings($bindings), $e
    673▕             );
    674▕         }
    675▕ 

我也在我的mac上使用Sequel Pro创建了一个数据库,但当我创建一个数据库时,我不确定它是否是按照它应该是的方式创建的。

其设置为:

代码语言:javascript
复制
host id: 127.0.0.1
username: root

.env中的设置为:

代码语言:javascript
复制
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=
EN

回答 1

Stack Overflow用户

发布于 2020-12-09 17:18:54

我试着一次又一次地使迁移,所以只看文件.env和禁用评论DB_HOST= mysql和启用DB_HOST=127.0.0.1现在再次尝试并把终端php工匠迁移,所以看一切都好!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64754484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档