Error 1148 MySQL the Used Command Is Not Allowed with This MySQL Version

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

You can specify that as an additional option when setting up your client connection:

mysql -u myuser -p --local-infile somedatabase

This is because that feature opens a security hole. So you have to enable it in an explicit manner in case you really want to use it.

Both client and server should enable the local-file option. Otherwise it doesn't work.To enable it for files on the server side server add following to the my.cnf configuration file:

loose-local-infile = 1

How to solve Error 1148 from MySql workbench and not cmd?

I believe this is an issue with the new versions of Workbench (having the same issue in Workbench 8.0.12). I did not have this issue in the 5.7.x version of Workbench, and downgrading to this version has fixed the issue for me.

This bug is documented here: https://bugs.mysql.com/bug.php?id=91891

I recommend either downgrading to an older version of Workbench, or using a different means to execute the command (such as through the mysql CLI command, or using another tool to connect such as DataGrip, etc).

Error:The used command is not allowed with this MySQL version' by mysqldb

Solved in
MySQL LOAD DATA LOCAL INFILE Python

MySQLdb.connect(server, username, password, database, local_infile = 1)

How to resolve used command not allowed in MySQL?

Q1:

To run sql commands in MySQL Shell you need to change from default JS to sql

R1:

type \sql to change from js to sql

mysql-js> \sql

Q2:
so I am not able to pass it as a parameter

For this you must be selecting 'MySQL x.x Command Line Client' under windows search.

To resolve you need to have mysql bin folder in environment path or do the below step to access

R2:

Goto "C:\Program Files\MySQL\MySQL Server x.x\bin" this is windows default path unless you change.

Then in the address bar if you click it will select ( i.e. C:\Program Files\MySQL\MySQL Server 5.7\bin) there just type cmd (Note: now in the address bar you will see only cmd) then press enter.

Once cmd window opens with the mysql path like below

C:\Program Files\MySQL\MySQL Server 5.7\bin>

Type blah..blah.. blah

mysql -u abcd -p password_here --local-infile=1

Note: If you just parse -p instead of -ppassword it will ask for password after that. So if you are going to type the password directly then type -pyourpass there will not be any spaces between -p and password



Related Topics



Leave a reply



Submit