启用 GAE PHP 运行时以允许本地文件批量插入到云 SQL
Enabling GAE PHP runtime to allow local infile bulk insertion to Cloud SQL
我遇到了 this article yesterday while researching how to boost insertion performance on Cloud SQL. This lead to finding out that that GAE for PHP supports LOAD DATA LOCAL INFILE,但是经过多次尝试和错误,我还没有在我当前的项目中正确实现它。
我已经单独尝试过 PDO 和 MySQLi 查询,并为 allow_local_infile 启用了选项,并且还编辑了 php.ini
[GAE Runtime Module]
google_app_engine.enable_functions = "phpversion, phpinfo, gc_enabled"
[mysql]
mysql.allow_local_infile = On
[mysqli]
mysqli.allow_local_infile = On
在配置并成功连接到云后调用 phpinfo() 时 SQL;
Directive Local Value Master Value
mysql.allow_local_infile Off Off
mysqli.allow_local_infile Off Off
导致此 PHP 致命错误:
SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version'
所以现在我想知道如何获取 php.ini 文件以在 PHP 的 GAE 上适当地更改这两个设置。我的 Google-fu 主要产生非 GAE 场景,因此重新安装 MySQL 并不是一个正确的选择。目前我只是在测试一个简单的本地 .txt 文件和一个 table,只有 2 列用于 'id' 和 'testcol'。任何建议或 GAE 具体示例将不胜感激!
App Engine PHP 已将 allow_local_infile 设置为 0, and you cannot change it from your apps php.ini file as it is PHP_INI_SYSTEM。
因此,使用 App Engine 时无法使用此功能 PHP。
我遇到了 this article yesterday while researching how to boost insertion performance on Cloud SQL. This lead to finding out that that GAE for PHP supports LOAD DATA LOCAL INFILE,但是经过多次尝试和错误,我还没有在我当前的项目中正确实现它。
我已经单独尝试过 PDO 和 MySQLi 查询,并为 allow_local_infile 启用了选项,并且还编辑了 php.ini
[GAE Runtime Module]
google_app_engine.enable_functions = "phpversion, phpinfo, gc_enabled"
[mysql]
mysql.allow_local_infile = On
[mysqli]
mysqli.allow_local_infile = On
在配置并成功连接到云后调用 phpinfo() 时 SQL;
Directive Local Value Master Value
mysql.allow_local_infile Off Off
mysqli.allow_local_infile Off Off
导致此 PHP 致命错误:
SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version'
所以现在我想知道如何获取 php.ini 文件以在 PHP 的 GAE 上适当地更改这两个设置。我的 Google-fu 主要产生非 GAE 场景,因此重新安装 MySQL 并不是一个正确的选择。目前我只是在测试一个简单的本地 .txt 文件和一个 table,只有 2 列用于 'id' 和 'testcol'。任何建议或 GAE 具体示例将不胜感激!
App Engine PHP 已将 allow_local_infile 设置为 0, and you cannot change it from your apps php.ini file as it is PHP_INI_SYSTEM。
因此,使用 App Engine 时无法使用此功能 PHP。