Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to edit /etc/my.cnf as root user via ssh and I get following error while trying to save it

I ma making changes to my.cnf as I want to tweak some values in my.cnf to meet Magento requirement like changing key_buffer_size= to higher value (128M). I assigned the value 128M to key_buffer_size= and tried to save it and then got an error.

"Error writing /etc/my.cnf: Permission denied"

I cant even restart MySQL successfully.

[root@flourish ~]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

I can even delete or replace it with the fresh one. I tried uninstalling MySQL and re-installing but nothing worked. Permission -rw-r--r-- and Owner/Group root/root

I hope there is some answer to this problem.

share|improve this question
    
How do you know you're root? –  Michael Hampton Nov 11 '12 at 5:03
    
I ma using username as root which I created while setting up the server. visudo root ALL=(ALL) ALL –  FlourishDNA Nov 11 '12 at 5:11
    
Please edit your question to specify exactly what you are doing, then. –  Michael Hampton Nov 11 '12 at 5:12
    
Hi @MichaelHampton I have added more details. Thanks –  FlourishDNA Nov 11 '12 at 5:24
add comment

1 Answer 1

up vote 2 down vote accepted

Has the file perhaps been made immutable with chattr? lsattr should tell you:

$ lsattr my.cnf
----i----------- my.cnf

would be the output for an immutable file.

share|improve this answer
    
Hi, Here is the output. ----i--------e- my.cnf –  FlourishDNA Nov 11 '12 at 13:05
    
Immutable it is :) Can be fixed with sudo chattr -i my.cnf –  Dennis Kaarsemaker Nov 11 '12 at 13:09
    
Hi Dennis, That did a trick. I am still having some issue installing web services No package httpd available. No package mod_ssl available. Is it something to do with immutable files? –  FlourishDNA Nov 11 '12 at 13:16
    
You might want to open a separate question for that and include your yum config. –  Dennis Kaarsemaker Nov 11 '12 at 13:18
    
Thanks for the help. I will open another thread. Great Day –  FlourishDNA Nov 11 '12 at 13:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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