MYSQL新特性secure_file_privファイルの読み書き


1290 – The MySQL server is running with the –secure-file-priv option so it cannot execute this statement
Secure-file-priv特性secure-file-privパラメータは、LOAD DATA、SELECT...OUTFILE、and LOAD_を制限するために使用されます.FILE()はどの指定ディレクトリに転送されますか.
  • ure_file_privの値はnullで、mysqldのインポートが許可されていないことを制限します|
  • をエクスポートします.
  • 当secure_file_privの値は/tmp/,mysqldのインポートを制限|エクスポートは/tmp/ディレクトリの下でのみ発生することを示す
  • .
  • 当secure_file_privの値に具体的な値がない場合はmysqldのインポート|エクスポートを制限
  • としないことを示す.
    secure-file-privパラメータの値を表示する方法は、次のとおりです.
    show global variables like '%secure%';

    随所に権限がない.
    mysql> show global variables like '%secure%';
    +------------------+-------+
    | Variable_name    | Value |
    +------------------+-------+
    | secure_auth      | OFF   |
    | secure_file_priv |       |
    +------------------+-------+
    2 rows in set (0.00 sec)
     

    エクスポート権限があります.エクスポートパスは/var/lib/mysql-files/下にある必要があります.
    mysql> show global variables like '%secure%';
    +--------------------------+-----------------------+
    | Variable_name            | Value                 |
    +--------------------------+-----------------------+
    | require_secure_transport | OFF                   |
    | secure_auth              | ON                    |
    | secure_file_priv         | /var/lib/mysql-files/ |
    +--------------------------+-----------------------+
    3 rows in set (0.09 sec)

    MYSQL新特性secure_file_privがファイルの読み書きに与える影響このスイッチのデフォルトはNULLです.つまり、インポートエクスポートは許可されません.
    問題を解決する:windowsの下:
    修正my.ini[mysqld]にsecure_を加えるfile_priv=
    linuxの下:
    修正my.cnfは[mysqld]にsecure_を加えるfile_priv=MYSQL新特性secure_file_privがファイルの読み書きに与える影響mysqlを再起動し、secure_をクエリーします.file_priv