Bobcares

Error Code 1148 MySQL Workbench: Resolved

Wondering how to fix Error Code 1148 MySQL Workbench? Our experts have the answer. Read on to learn more. Our MySQL Support Services team is here to offer a lending hand with your queries and issues.

How to fix: Error Code 1148 MySQL Workbench

Have you been running into trouble while trying to load data into a table in MySQL? If you have been coming across the following error. You have come to the right place.

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

Error Code 1148 MySQL Workbench

The Error Code 1148 MySQL Workbench often pops up while loading data into a table with a .txt file via MySQL.

mysql> LOAD DATA LOCAL INFILE 'path/file.txt' INTO TABLE table_name LINES TERMINATED BY '\r';Copy Code

When loading data into a table using a .txt file using MySQL, the MySQL Command-Line Client that comes with the MySQL 8.0.18 package and executing this command:

Fortunately, our experts have a solution for this issue. It involves ensuring the MySQL server as well as the MySQL Command-Line client can read files locally. In other words, we have to enable the MySQL server as well as the MySQL Command-Line client to read files locally since it is disabled by default.

This can be done with the following command:

mysql> SET GLOBAL local_infile=1;Copy Code

Here, ‘1’ indicates that we are setting it to ON.

We can check this by running the following command:

mysql>SHOW VARIABLES;Copy Code

This will display that local_infile is now ON.

Next, we have to restart the MySQL Command-Line client session in the terminal.

$sudo bin/mysql -u user -p –local-infile=1Copy Code

Now. When we run the following command, our query will be OK and will not encounter Error Code 1148.

mysql> LOAD DATA LOCAL INFILE 'path/file.txt' INTO TABLE table_name LINES TERMINATED BY '\r';Copy Code

Let us know in the comments if this helped resolve the Error Code 1148 issue. If not, drop us a line, and our experts will help you out in a jiffy.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

To sum up, our Support Engineers demonstrated how to resolve Error Code 1148. We also found out how this error occurs and how to put a stop to it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Speed issues driving customers away?
We’ve got your back!