gpt4 book ai didi

php - Laravel 代客 MySQL 错误 : user specified as definer does not exist

转载 作者:行者123 更新时间:2023-11-29 03:17:56 25 4
gpt4 key购买 nike

在全新安装的 Laravel 上,运行 Valet,应用运行良好。

问题是尝试使用 MySQL 设置数据库。我可以创建一个数据库,告诉 MySQL 使用它,但不能用它做任何事情:

mysql> create database foobar;
Query OK, 1 row affected (0.09 sec)

mysql> use foobar;
Database changed

mysql> show tables;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

如果我尝试 php artisan migrate 我会得到以下信息:

PDOException  : SQLSTATE[HY000] [2006] MySQL server has gone away

at /Users/isaacfennell/Sites/anything/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
64| if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
65| return new PDOConnection($dsn, $username, $password, $options);
66| }
67|
> 68| return new PDO($dsn, $username, $password, $options);
69| }
70|
71| /**
72| * Determine if the connection is persistent.

Exception trace:

1 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=anything", "root", "", [])
/Users/isaacfennell/Sites/anything/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

2 Illuminate\Database\Connectors\Connector::createPdoConnection("mysql:host=127.0.0.1;port=3306;dbname=anything", "root", "", [])
/Users/isaacfennell/Sites/anything/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:98

Please use the argument -v to see more details.

我是 Laravel 和 MySQL 的新手,不知道如何解决这个问题 - 这是怎么回事?谢谢

最佳答案

解决了第一个问题:

运行 mysql_upgrade -u root

在这里找到:Mysql Error:The user specified as a definer ('mysql.infoschema'@'localhost') does not exist' when trying to dump tablespaces

但是运行 php artisan migrate 仍然给出与上面相同的错误输出......

关于php - Laravel 代客 MySQL 错误 : user specified as definer does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51548580/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com