eZ Platform: Error: "SQLSTATE[HY000] [2002] No such file or directory" when I try to generate GraphQL schema
eZ Platform: Error: "SQLSTATE[HY000] [2002] No such file or directory" when I try to generate GraphQL schema
我已经使用 eZ Launchpad 文档在我的 Mac 上安装了 eZ 平台:https://ezsystems.github.io/launchpad/。
安装后,我能够成功访问平台并开始创建内容模型。
我也想使用 GraphQL,所以我按照说明操作:https://doc.ezplatform.com/en/latest/api/graphql/。
不幸的是,当我尝试使用以下命令生成架构时出现错误:
php bin/console ezplatform:graphql:generate-schema
php bin/console cache:clear
这是我得到的错误:
In ExceptionConversion.php line 169:
Database error
In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 31:
SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] No such file or directory
这是 app/config/parameters.yml:
# This file is auto-generated during the composer install parameters:
env(SYMFONY_SECRET): ThisEzPlatformTokenIsNotSoSecret_PleaseChangeIt
env(DATABASE_DRIVER): pdo_mysql
env(DATABASE_HOST): localhost
env(DATABASE_PORT): null
env(DATABASE_NAME): ezplatform
env(DATABASE_USER): root
env(DATABASE_PASSWORD): null
env(DATABASE_CHARSET): utf8mb4
env(DATABASE_COLLATION): utf8mb4_unicode_520_ci
env(DATABASE_VERSION): mariadb-10.2.26
看起来您已经直接从您的主机执行了 composer 和 symfony 命令,并且您已经使用启动板设置了项目。
试试这个:
~/ez sfrun ezplatform:graphql:generate-schema
~/ez sfrun cache:clear
使用 ezlaunchpad,您的应用在 docker 容器中 运行,因此您必须通过 ~/ez shell 执行所有常见的 symfony/ez 命令。从主机执行命令也会导致文件权限问题。
我已经使用 eZ Launchpad 文档在我的 Mac 上安装了 eZ 平台:https://ezsystems.github.io/launchpad/。
安装后,我能够成功访问平台并开始创建内容模型。
我也想使用 GraphQL,所以我按照说明操作:https://doc.ezplatform.com/en/latest/api/graphql/。
不幸的是,当我尝试使用以下命令生成架构时出现错误:
php bin/console ezplatform:graphql:generate-schema
php bin/console cache:clear
这是我得到的错误:
In ExceptionConversion.php line 169:
Database error
In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 31:
SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] No such file or directory
这是 app/config/parameters.yml:
# This file is auto-generated during the composer install parameters:
env(SYMFONY_SECRET): ThisEzPlatformTokenIsNotSoSecret_PleaseChangeIt
env(DATABASE_DRIVER): pdo_mysql
env(DATABASE_HOST): localhost
env(DATABASE_PORT): null
env(DATABASE_NAME): ezplatform
env(DATABASE_USER): root
env(DATABASE_PASSWORD): null
env(DATABASE_CHARSET): utf8mb4
env(DATABASE_COLLATION): utf8mb4_unicode_520_ci
env(DATABASE_VERSION): mariadb-10.2.26
看起来您已经直接从您的主机执行了 composer 和 symfony 命令,并且您已经使用启动板设置了项目。
试试这个:
~/ez sfrun ezplatform:graphql:generate-schema
~/ez sfrun cache:clear
使用 ezlaunchpad,您的应用在 docker 容器中 运行,因此您必须通过 ~/ez shell 执行所有常见的 symfony/ez 命令。从主机执行命令也会导致文件权限问题。