Error writing my.cnf: Permission denied
Asked Answered
K

3

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!

Kick answered 20/5, 2015 at 14:33 Comment(3)
perhaps sudo needs to be used for those commands.Darbies
Who is the owner of my.cnf? Root? Then you need to become root also (su or sudo). Also you need to change the permissions so that mysql user will be able to read it (as root, you can write also to files with these permissions).Parliamentarian
You need super privilege to save the file.Subway
S
7

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

sudo chmod 644 my.cnf

sudo nano my.cnf
Shannashannah answered 27/11, 2018 at 7:1 Comment(0)
B
5
sudo chmod 644 my.cnf

sudo pico my.cnf
Bang answered 11/7, 2015 at 10:46 Comment(0)
C
3

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

Characharabanc answered 20/5, 2015 at 14:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.