teleport icon indicating copy to clipboard operation
teleport copied to clipboard

MySQL proxy server missing CLIENT_LOCAL_FILES capability

Open smallinsky opened this issue 2 years ago • 1 comments

Description

Teleport MySQL proxy server uses hardcoded lists of MySQL cap server_conf.go#L78 where CLIENT_LOCAL_FILES is missing. If end server support one of the disabled capability the end user is not able to execute some commands.

What happened: After connecting to database with mysql ... --local-infile=1 cap where the server supports local_infile

mysql> SHOW GLOBAL VARIABLES LIKE 'local_infile';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile  | ON    |
+---------------+-------+

And executing the LOAD DATA LOCAL INFILE query:

mysql> LOAD DATA LOCAL INFILE '/tmp/loaddata7.dat' into table t1 fields terminated by ',' (a,b) set c=a+b;

One of following error is returned (depending on MySQL version) :

  • ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides
  • ERROR 1148 (42000): The used command is not allowed with this MySQL version

What you expected to happen: MySQL server caps should be set properly allowing a user to execute LOAD DATA LOCAL INFILE command the requires CLIENT_LOCAL_FILES MySQL capability.

smallinsky avatar Apr 24 '22 18:04 smallinsky

I've verified this issue occurs using mysql v8 & teleport v9.0.1.

jwieder avatar Aug 09 '22 21:08 jwieder

Any update on this issue ? will this be fixed in upcoming release?

dhanesh012 avatar Jan 17 '24 10:01 dhanesh012