MySQL throws Error 1148 (ER_NOT_ALLOWED_COMMAND) when a client issues a command, such as LOAD DATA LOCAL INFILE, that the server or client has disabled for security reasons.
MySQL Error 1148: ER_NOT_ALLOWED_COMMAND means the server blocked a potentially unsafe statement like LOAD DATA LOCAL INFILE. Enable the feature on both client and server or use secure alternatives to resolve the error.
The used command is not allowed with this MySQL version
Error 1148 appears with the message "The used command is not allowed with this MySQL version." It signals that the server or client library has disabled a command the session tried to run, most often LOAD DATA LOCAL INFILE.
MySQL disables LOCAL file loading by default in many distributions to guard against reading arbitrary files from a client machine.
When the client or server sees the request, it returns SQLSTATE 42000 and halts execution.
The primary trigger is executing LOAD DATA LOCAL INFILE or SELECT ... INTO OUTFILE when either the client or server has disabled local file capability via --local-infile=0 or skip-load-data-local-infile.
Upgraded servers can reset secure-file-priv, breaking existing scripts that write or read local files.
Some hosting providers forcibly disable LOCAL to reduce risk, producing the same error.
First, confirm whether the feature is intentionally disabled. If you need LOCAL file loading, set local_infile = 1 in my.cnf and restart the server. The client must also enable LOCAL with --local-infile or by executing SET GLOBAL local_infile = 1 as a privileged user.
If enabling the feature is impossible for policy reasons, rewrite the workflow.
Upload files to the server's filesystem and use LOAD DATA INFILE without LOCAL, or stage data in a temporary table via INSERT statements generated by tooling.
CICD pipelines often fail after moving to managed MySQL services that disable LOCAL. Fix by using server-side file uploads or S3 + mysqlimport remote data load.
Data scientists running Galaxy's SQL editor may hit Error 1148 during bulk loads.
Galaxy prompts users to enable LOCAL with a one-click connection flag, or offers a secure file upload dialog that stores data in the server tmp directory before issuing LOAD DATA INFILE.
Keep server and client local_infile settings in sync across environments. Document the policy in version control.
Use parameterized import scripts that detect capabilities via SHOW GLOBAL VARIABLES LIKE 'local_infile'.
When security teams forbid LOCAL, adopt a standard server-side import path and restrict secure-file-priv to a dedicated directory. Galaxy collections can store vetted examples so all engineers follow the same pattern.
ERROR 1290 SQLSTATE 42000 - "The MySQL server is running with the --secure-file-priv option" signals that file import/export is limited to a specific directory.
Fix by moving the file into the permitted path.
ERROR 1045 SQLSTATE 28000 - Access denied for user - arises if the account lacks FILE privilege. Grant FILE on *.* to 'user'@'host' to resolve.
.
Yes. Run SET GLOBAL local_infile = 1 as a privileged user. Clients still need --local-infile=1.
Potentially. Attackers could read client-side files if they gain FILE privilege. Restrict users and vet file paths.
Galaxy flags the LOCAL setting during connection setup and offers a secure server-side upload workflow, preventing accidental 1148 errors.
MySQL 8 installs with local_infile disabled by default. Re-enable it or migrate to server-side imports.