Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error executing SQL script; The process cannot access the file because it is being used by another process:'C:\\Users\\......\....cnf'

I am trying to run a script to import data into MySQL. When I tried, this error shown up. I have searched for a workaround but none is helping. I deleted all the related .cnf file in the said path after a few attempts on trying to run the script but it kept on creating a new one. I have no other means of importing the data besides running that script. Terribly sorry if I somehow really ask a silly question about this but I am new with SQL, stuck and need help on the matter. Thanks in advance. enter image description here

like image 500
Nadhirah21 Avatar asked Jan 19 '21 16:01

Nadhirah21


2 Answers

i have the same error as you, I've manage to solve it on my end by following these steps:

  1. Rather than doing "run sql script", do "open sql script"
  2. After the script open, Execute all (the lightning btn beside the save icon)

Hope this will work for you too!

like image 74
vika Avatar answered Dec 04 '22 11:12

vika


I ran into this problem as well and, like @Alexandre-St-Amant, the size of my script prohibited opening the script as @vika suggests.

Before noticing @Kwaadpepper's suggestion, I tried using connecting to my database through mysqlsh.exe, then used SOURCE <data_file>. This has the added benefit of allowing linked scripts using SOURCE, solving @Adrian-Moldovan's issue.

Of course, this does not use mysql-workbench to solve the problem.

like image 36
Zach Longhofer Avatar answered Dec 04 '22 10:12

Zach Longhofer