Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel-8:php artisan迁移不工作_Php_Mysql_Laravel 8_Sequelpro - Fatal编程技术网

Laravel-8:php artisan迁移不工作

Laravel-8:php artisan迁移不工作,php,mysql,laravel-8,sequelpro,Php,Mysql,Laravel 8,Sequelpro,我试着运行命令:php artisan migrate,但它给出了以下错误 错误: 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 whe

我试着运行命令:php artisan migrate,但它给出了以下错误

错误:

   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创建了一个数据库,但当我创建一个数据库时,我不确定它是否按照预期的方式创建

其设置为:

host id: 127.0.0.1
username: root
.env中的设置包括:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=

我试着一次又一次地这么做 所以只需查看file.env并禁用注释DB_HOST=mysql并启用DB_HOST=127.0.0.1
现在再次尝试将终端php artisan迁移,这样看起来一切正常

奇怪的是,它试图使用
mysql.infoschema
作为用户。如果您在linux或Mac计算机上,请从根目录尝试此操作,以查看该字符串的来源:
grep-R'mysql.infoschema'*.
output:./storage/logs/laravel.log:[2020-11-10 09:23:34]local.ERROR:SQLSTATE[HY000]:一般错误:1449指定为定义者的用户('mysql.infoschema'@'localhost')不存在(SQL:select*from information_schema.tables,其中table_schema=test和table_name=migrations,table_type='BASE table'){“exception”:“[object](light\\Database\\QueryException(代码:HY000):SQLSTATE[HY000]:一般错误:1449指定为定义者的用户('mysql.infoschema'@'localhost')不存在(SQL:select*来自/Users/akansha/Desktop/project/vendor/laravel/framework/src/illusted/Database/Connection.php:671上的information_schema.tables,其中table_schema=test和table_name=migrations以及table_type='BASE table)