Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

515
Visualizações
Error code 2068: file requested rejected due to restrictions on access with root user

Hey everyone im having this problem trying to import a CSV on mysql. im using the root user to make sure i have all the grants and access but stil it keeps giving me the same error. The queries im using are the following:

CREATE table if not exists Order_items(
    order_id VARCHAR(255) NOT NULL,
    order_item_id VARCHAR(255) NOT NULL,
    product_id VARCHAR(255) NOT NULL,
    seller_id VARCHAR(255) NOT NULL,
    shipping_limit_date datetime NOT NULL,
    price INT NOT NULL,
    freight_value INT NOT NULL,
    PRIMARY KEY(order_id)
);

load data local infile 'C:\Users\julia\Desktop\SUPR\Test\olist_order_items_dataset.csv' 
into table order_items
FIELDS terminated by ','
optionally enclosed by '"'
lines terminated by '\n'
ignore 1 rows
(order_id, order_item_id, product_id, seller_id, shipping_limit_date, price, freight_value); `

Error code 2068: file requested rejected due to restrictions on access with root user

I have tried everything but it still gives me the same error due to restrictions.

Thanks

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Change the back slashes (\) to forward slashes (/) in the file path. Run the file again. Even if the error persists, then follow the method below.

  1. Go to the MySQL Connections page.
  2. Right click the connection and click 'Edit connection'.
  3. Select 'Advanced' option. Paste the below line in the 'Others' box.
OPT_LOCAL_INFILE=1
  1. Click 'Test Connection'. It will successfully update the connection.
  2. Click close.

enter image description here enter image description here enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

I was getting the same error on windows using mysql workbench. When I changed the path from C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\myfile.csv to C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/myfile.csv it worked just fine. I didn't have to add local before infile

Make sure you enable infile loading SET GLOBAL local_infile=1; and are putting the files in the correct directory. You can run SHOW VARIABLES LIKE "secure_file_priv"; to see where that directory is located.

Assuming C:\Users\julia\Desktop\SUPR\Test is where mysql wants the uploads, which by default that isn't the case it is C:\ProgramData\MySQL\MySQL Server 8.0\Uploads then your statement would be

load data infile 'C:/Users/julia/Desktop/SUPR/Test/olist_order_items_dataset.csv' 
into table order_items
FIELDS terminated by ','
optionally enclosed by '"'
lines terminated by '\n'
ignore 1 rows
(order_id, order_item_id, product_id, seller_id, shipping_limit_date, price, freight_value); 
over 4 years ago · Santiago Trujillo Relatório

0

The local_infile option should be enabled both on client and server sides, and you could find answer here:

ERROR:loading local data is disabled

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda