I try to do this code:
$conn = mysqli_init();
mysqli_options($conn, MYSQLI_OPT_LOCAL_INFILE, true);
mysqli_real_connect($conn,'{HOST}','{USERNAME}','{PASSWD}','{DBNAME}');
$x = mysqli_query($conn, "LOAD DATA LOCAL INFILE '/var/www/sample.txt' INTO TABLE temp");
if($x){
echo "OK";
}else{
echo mysqli_error($conn);
}
and i have this error:
The used command is not allowed with this MariaDB version
On server MariaDB, but it's not mean - just public fork of MySQL.
So, i have in php.ini on client:
mysqli.allow_local_infile = 1
mysql.allow_local_infile = 1
I have on server:
SHOW GLOBAL VARIABLES LIKE 'local_infile';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile | ON |
+---------------+-------+
1 row in set (0.023 sec)
What's wrong and how to resolve it ?
question from:
https://stackoverflow.com/questions/65866448/php-mysqli-cant-load-data-local 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…