Bug #94396 Error message too broad: The used command is not allowed with this MySQL version
Submitted: 19 Feb 2019 17:09 Modified: 18 Feb 2021 9:32
Reporter: Bill Karwin (Candidate Quality Contributor) (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.6/5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[19 Feb 2019 17:09] Bill Karwin
Description:
When using LOAD DATA LOCAL INFILE without enabling the right options, the error message does not tell the user what it means, or what they should do to fix the problem.

The error in the code is ER_NOT_ALLOWED_COMMAND, which occurs when the client executes LOAD DATA LOCAL INFILE without enabling the local_infile option.

The same error was also emitted in past versions of MySQL Server, if MySQL Server was built with with a compile macro DONT_ALLOW_SHOW_COMMANDS, and the client tried to execute a SHOW command. But that code seems to have been removed in 2013 for BUG#16391701

https://github.com/mysql/mysql-server/commit/5ec33b9093a5a73ca225377884ff89efa5a06f7d

The error "The used command is not allowed with this MySQL version" is now too broad, covering an error case that no longer exists in the code, and also is too vague, not telling the user how to fix it.

Also, the reference to "this MySQL version" is misleading, because it gives the impression that the error could be fixed by upgrading or downgrading MySQL.

How to repeat:
mysql> load data local infile 'foo.txt' into table foo;

ERROR 1148 (42000): The used command is not allowed with this MySQL version

Suggested fix:
Change the wording of the error message to help the user understand what to do when local_infile is not configured.

Any error message should explain enough to make the user understand what they need to do, or at least what they need to read about.

Here's a suggestion for wording:

Loading local data is disabled; set local_infile=1 in both the server and client options to enable.
[19 Feb 2019 18:58] MySQL Verification Team
Thank you for the bug report.
[17 Nov 2019 22:47] Jesper wisborg Krogh
Posted by developer:
 
From Bug 30375698/Bug 97079:

Fixed in 8.0.19.

Previously, the server returned this error message for attempts to
use LOAD DATA LOCAL with LOCAL capability disabled: "The used command
is not allowed with this MySQL version". This was misleading because
the error condition is not related to the MySQL version. The server
now returns an error code of ER_CLIENT_LOCAL_FILES_DISABLED and this
message: "Loading local data is disabled; this must be enabled on
both the client and server side".