MySQL blocks a LOAD DATA LOCAL INFILE request because local file loading has been disabled on either the server or client.
MySQL Error 2068: CR_LOAD_DATA_LOCAL_INFILE_REJECTED means the server rejected LOAD DATA LOCAL INFILE because LOCAL loading is disabled. Re-enable it by starting the client with --local-infile or setting local_infile=1 on the server, then rerun the import.
LOAD DATA LOCAL INFILE file request rejected due to restrictions on access. CR_LOAD_DATA_LOCAL_INFILE_REJECTED was added in 8.0.21.
Error 2068 appears when a client issues LOAD DATA LOCAL INFILE and the server refuses the request. MySQL returns the message: “LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.” The error was introduced in MySQL 8.0.21 and is classified as a client-side error.
The keyword LOCAL instructs the client to read data from its own file system and stream it to the server. Administrators often disable this feature for security.
If either the client library or the server has LOCAL loading turned off, the request fails immediately with code 2068.
Most occurrences trace back to the server system variable local_infile being set to OFF. When OFF, the server rejects every LOCAL file load regardless of client flags, returning CR_LOAD_DATA_LOCAL_INFILE_REJECTED.
The client program itself can also block LOCAL loading.
MySQL Shell, mysql CLI, and some connectors disable LOCAL unless you start them with the --local-infile option or set MYSQL_OPT_LOCAL_INFILE at runtime.
First, verify whether the server allows LOCAL loading: SELECT @@GLOBAL.local_infile;. If it returns 0, enable it with SET GLOBAL local_infile = 1; then restart or reconnect so the change takes effect.
Next, confirm the client is launched with --local-infile or equivalent connector flag.
When server changes are impossible, remove LOCAL from the statement and place the file on a directory accessible to the server. Then use LOAD DATA INFILE '/var/lib/mysql-files/data.csv' instead, granting the FILE privilege if needed.
Shared hosting environments force local_infile to OFF. In that case, upload the file to a secure directory on the server and switch to non-LOCAL import.
CI pipelines often use the mysql client without --local-infile.
Add mysql --local-infile -h${HOST} -u${USER} -p${PASS} < script.sql to enable imports in automated jobs.
Keep LOCAL loading disabled in production and enable it only for trusted users on development machines. Rotate credentials and limit FILE privileges to reduce risk of arbitrary file reads.
Galaxy users can save approved import scripts in a Collection and run them from the fast local editor.
Galaxy maintains execution history, making it easy to audit who enabled LOCAL and when.
Server error 1148 (42000) “The used command is not allowed with this MySQL version” also fires when local_infile is OFF, but it appears on the server side. The fix is identical: turn on local_infile or drop LOCAL.
Error 1045 (28000) “Access denied for user” surfaces when the session lacks FILE privilege. Grant FILE on *.* to user@host; resolves it.
.
Enable it only for trusted users and consider a read-only server directory. Disable it globally once the import is complete.
No. FILE privilege is needed only for non-LOCAL imports. LOCAL imports run solely with client file read permissions.
MySQL introduced a clearer client-side code for this scenario. Your previous setup already blocked LOCAL loads, but the server now uses 2068 to indicate it.
Galaxy surfaces server variables, warns when local_infile is OFF, and lets you share corrected scripts so teammates avoid 2068.