Warning: PDO::query(): LOAD DATA LOCAL INFILE forbidden

エラーメッセージWarning

エラーメッセージ

 状態:-  閲覧数:2,328  投稿日:2017-10-05  更新日:2017-10-06  
Warning: PDO::query(): LOAD DATA LOCAL INFILE forbidden


エラー対応


PHP経由で「LOAD DATA LOCAL INFILE」処理する場合には?
・PDOオブジェクトを呼び出す際、下記を設定する必要がある
array(PDO::MYSQL_ATTR_LOCAL_INFILE => true)

PDO::MYSQL_ATTR_LOCAL_INFILE
・LOAD LOCAL INFILE を有効にする
・この定数を使用できるのは、新しいデータベースハンドルを作るときの driver_options 配列内だけ
$pdo = new PDO(
   'mysql:host=hostname;dbname=ssldb',
   'username',
   'password',
   [PDO::MYSQL_ATTR_LOCAL_INFILE => true]
);



PHP: MySQL (PDO)
MySQL PHP API :: 4 MySQL Functions (PDO_MYSQL)







Warning: mb_convert_encoding(): Unable to detect character encoding

コメント投稿(ログインが必要)



類似度ページランキング
順位 ページタイトル抜粋
1 Warning: PDO::query(): LOAD DATA LOCAL INFILE forbidden 53
2 Parse error: syntax error, unexpected T_INCLUDE, expecting T_FUNCTION 35
3 Parse error: syntax error, unexpected T_INCLUDE_ONCE, expecting T_FUNCTION 34
4 Parse error: syntax error, unexpected 'public' (T_PUBLIC) 34
5 Warning: Division by zero 33
6 Parse error: syntax error, unexpected T_REQUIRE, expecting T_FUNCTION 32
7 Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused 32
8 Parse error: syntax error, unexpected 'new' (T_NEW) 32
9 Parse error: syntax error, unexpected T_DECLARE, expecting T_STRING in ○○ on lin 31
10 Parse error: syntax error, unexpected T_REQUIRE_ONCE, expecting T_FUNCTION 31
11 Parse error: syntax error, unexpected T_DOUBLE_ARROW in △△ on line □□ 31
12 Fatal error: Uncaught Error: Call to undefined function bcsub() 31
13 Fatal error: require_once(): Failed opening required 'PEAR.php' 30
14 Fatal error: Call to undefined function **() 30
15 Fatal error: Uncaught Error: Call to a member function modify() on string 30
16 ( ! ) Warning: Declaration of xxxx should be compatible with 30
17 ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined 29
18 ( ! ) Fatal error: Uncaught Abraham\TwitterOAuth\TwitterOAuthException 29
19 No data available for specified ID 27
20 ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'カラム名' cannot be null 27
2025/5/31 11:41 更新
週間人気ページランキング / 5-24 → 5-30
順位 ページタイトル抜粋 アクセス数
1 PHPにおけるメソッドのオーバーライドについて /「引数の数や型は、親クラスのメソッドと完全に一致していなければなりません。」とは具体的にどういう意味ですか? 5
2 http_build_queryとは? / 構文 /パラメータ 4
2 Parse error: syntax error, unexpected 'public' (T_PUBLIC) | Parse error(エラーメッセージ) 4
3 セッション管理が必要な理由は、HTTPプロトコルには状態を保持する機能がないため | セッション 3
3 htmlspecialchars / htmlentities / addslashes / mysql_real_escape_string / mysqli_real_escape_string | セキュリティ 3
3 ブラウザを閉じたらセッションデータはどうなるの? | セッション 3
4 ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column | Fatal error(エラーメッセージ) 2
4 set_error_handler | 例外処理(制御構造) 2
4 $this | クラスとオブジェクト 2
4 Fatal error(エラーメッセージ) カテゴリー 2
4 PHPで定数を定義する方法は2種類ある / 配列定数の定義 2
4 Warning: session_write_close(): Failed to write session data (user) | Warning(エラーメッセージ) 2
4 ( ! ) Warning: Declaration of xxxx should be compatible with | エラーメッセージ 2
4 ( ! ) Fatal error: Uncaught Abraham\TwitterOAuth\TwitterOAuthException: {"errors":[{"code":32,"message":"Could not authenticate you."}]} | Fatal error(エラーメッセージ) 2
4 インポートするデータを受信できませんでした。ファイル名が送信されていないか、ファイルサイズが PHP の設定で許可された最大値を超えています。FAQ 1.16 をご覧ください | エラーメッセージ 2
4 Fatal error: require_once(): Failed opening required 'PEAR.php' | Fatal error(エラーメッセージ) 2
4 Fatal error: Uncaught Wrench\Exception\HandshakeException: No accept header receieved on handshake response in ★★★ headless-chromium-php/vendor/wrench/wrench/lib/Wrench/Protocol/Protocol.php | エラーメッセージ 2
4 Fatal error: Uncaught Error: Call to a member function modify() on string | Fatal error(エラーメッセージ) 2
4 可変変数 | 変数 2
4 クロージャ | 関数 2
2025/5/31 1:01 更新