New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table Import with CSV using LOAD DATA LOCAL causes error "LOAD DATA LOCAL INFILE is forbidden" #16942
Comments
|
Hi @jormaster3k Thank you for the report, here is some patches that could be related Do you have a "CSV using LOAD DATA" option in your Import select page ? If you make this line always true, does it work ?
|
|
Hi @williamdes, Yes, I have the "CSV using LOAD DATA" option, that is exactly what I am using. Thanks for the change references. I tried removing the if ($format === 'ldi') check from ImportController.php, ensuring that we define PMA_ENABLE_LDI unconditionally. However, I still received the error. If in libraries/classes/Dbi/DbiMysqli.php I change the defined('PMA_ENABLE_LDI') check so that we always set the mysqli option MYSQLI_OPT_LOCAL_INFILE to true, the import works! if (true) {
$mysqli->options(MYSQLI_OPT_LOCAL_INFILE, true);
} else {
$mysqli->options(MYSQLI_OPT_LOCAL_INFILE, false);
}Next I tried simply defining PMA_ENABLE_LDI just before checking it: define('PMA_ENABLE_LDI', 1);
if (defined('PMA_ENABLE_LDI')) {
$mysqli->options(MYSQLI_OPT_LOCAL_INFILE, true);
} else {
$mysqli->options(MYSQLI_OPT_LOCAL_INFILE, false);
}With this method, the import works as well, but interestingly I receive a notice in ImportController.php about PMA_ENABLE_LDI already being defined:
This leads me to believe that the code in ImportController.php is being triggered after the code in DbiMysqli.php, and accordingly it won't work to try and define PMA_ENABLE_LDI there. Unfortunately I don't know enough about the application in order to determine a better approach :( |
|
Hi @jormaster3k |
… "LOAD DATA LOCAL INFILE is forbidden" Signed-off-by: William Desportes <williamdes@wdes.fr>
Signed-off-by: William Desportes <williamdes@wdes.fr>
|
I just built the latest 5.1 version in development (phpMyAdmin 5.1+snapshot), it contains the fix. Feel free to try it and let me know |
Describe the bug
Beginning with PHPMyAdmin 5.1.0, I'm no longer able to use the table import function with CSV using LOAD DATA LOCAL.
Attempting to perform an import returns the following error:
This works without any issues on PHPMyAdmin 5.0.4
Here is the URL that is impacted:
5.0.4
5.1.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect that the import will complete successfully, with the following message on the page:
Observed behavior
Process fails with following error
Server configuration
Client configuration
Additional context
I have installed PHPMyAdmin 5.0.4 and 5.1.0 side-by-side on the same server, in the same parent directory, see below:
So there should be no server, PHP, or webserver configuration differences, only a difference in PHPMyAdmin version. This leads me to believe that it's a regression bug with PHPMyAdmin 5.1.0.
I have also verified this is broken in most recent 5.1.1 version as well.
I also verified in my PHP configuration by way of calling phpinfo() in the PHPMyAdmin directory that mysqli.allow_local_infile=On, but that doesn't seem to make a difference.
The text was updated successfully, but these errors were encountered: