I recently installed mysql-workbench by installing first apt-config.deb from mysql website and then install the actuall mysql with sudo apt-get install mysql-workbenh (I used sudo for almost everything). When I run the program I get errors in the console like this:

Exception in logger: Could not create directory /home/nosthertus/.mysql/workbench/log: Permission denied


I/O error : Permission denied I/O error : Permission denied

For a moment I thought I just don't have permission to write/execute in .mysql folder, so to check I executed ll and found this:

drwxr-xr--  3 root       root       4096 mar  5 18:49 .mysql/

I tried to change permissions using sudo chmod 757 .mysql, but when I execute the program again, I get the error I/O error: Permission denied

This does not happen when I run mysql-workbench with sudo.. but I don't want to be executing a terminal for each program that needs to do the same process for permissions and I need the console for logging my errors on the applications I code.

  • You probably need to change the ownership rather than the permissions e.g. (assuming your username and primary group are both nosthertus), sudo chown -R nosthertus:nosthertus ~/.mysql. Then restore the original permissions on the directory (likely 755). Mar 8 '16 at 6:15
  • I tried your method and errors no longer appears.. is this the recommended way to do after installing applications through sudo? Mar 8 '16 at 23:51
  • You'd need to provide details of exactly what commands you ran in order for anyone to identify which (if any) should have been run using sudo Mar 8 '16 at 23:55
  • @steeldriver i did provide the details of the commands i ran. Mar 8 '16 at 23:58
  • 1
    Huh? "I recently installed mysql-workbench using sudo (I used sudo for almost everything)" Mar 9 '16 at 0:00

This problem happens because .mysql was created by root user using sudo and the permissions are to only read for others that are not the owner..

To simply fix this issue, change the owner of the folder to the desired user using this command in terminal:

sudo chown -R <user>:<group> .mysql

what this command does? i will explain each one of them

sudo stands for "switch user and do" which is actually changing the user to root internally for this operation

chown stands for "change owner" and it does what actually it means, of course for this command to work properly on a folder. the owner of the folder has to run it, in this case was root so sudo was necessary

-R this parameter is actually from chown and it applies the same command recursively to all sub folders/files

<user>:<group> this is just the desired owner and group we would like to assign to folder/file and its a mandatory parameter from chown. Also you have to enter the source of the folder/file next to this parameter

you can check more options for chown using man chown

  • after I did this, workbench has issues starting as it was unable to open some files, wrong permission :-/. SO I had to change permissions back and just save in a non root area. May 5 '18 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.