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

エラーメッセージWarning

エラーメッセージ

 状態:-  閲覧数:2,596  投稿日: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
2026/7/21 15:19 更新
週間人気ページランキング / 7-14 → 7-20
順位 ページタイトル抜粋 アクセス数
1 PHP用語 10
2 コンストラクタ デストラクタ | クラスとオブジェクト 4
3 ログイン 3
4 型キャスト | 型 2
4 セッション名 | セッション 2
4 エラーレベル一覧(error_reportingの設定) 2
4 カテゴリ一覧 2
4 ゲストコメント一覧ページ 2
4 Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 23 Out of resources when opening file '/tmp/#sql_2dd6_0.MYI' (Errcode: 24)' | エラーメッセージ 2
4 実際に遭遇した例 2
4 session.entropy_fileデフォルト設定値 2
4 デリミタ 2
4 PHPで定数を定義する方法は2種類ある / 配列定数の定義 2
4 Parse error: syntax error, unexpected $end in ○○.php on line △△ | Parse error(エラーメッセージ) 2
4 PHPでcurlを使用するためには?/ 2.オプション設定 / curlでPOST送信 2
4 You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. | Twitter API(エラーメッセージ) 2
4 htmlspecialchars / htmlentities / addslashes / mysql_real_escape_string / mysqli_real_escape_string | セキュリティ 2
4 デフォルト引数 | 関数 2
4 Fatal error: Uncaught Error: Class 'Mecab_Tagger' not found in /var/www/★★.php:☆☆ | Fatal error(エラーメッセージ) 2
4 遭遇例1.存在する間違ったデータベース名を指定 2
2026/7/21 5:05 更新