7

I'm attempting to edit my my.cnf file to allow remote access to mysql (by changing the bind-address). However, I'm getting a "Error writing my.cnf: Permission denied" error when I try to save (using pico through SSH).

Running $ lsattr my.cnf returns ---------------- my.cnf

What do I need to do to be able to edit this file?

Thanks!

Jonas
  • 121,568
  • 97
  • 310
  • 388
user994585
  • 661
  • 3
  • 13
  • 28

3 Answers3

7

You need to set the file permission as readable and writable.

sudo chmod 644 my.cnf

sudo nano my.cnf
sethupathi
  • 81
  • 1
  • 3
5
sudo chmod 644 my.cnf

sudo pico my.cnf
dev-seahouse
  • 163
  • 1
  • 6
3

Try to edit it as root. Or look for at the file owner and file right with an ls -a.

Leze
  • 739
  • 5
  • 24