Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to edit the my.cnf file in Applications/XAMPP/xamppfiles/etc but it is locked. So I tried unlocking it using

cd /Applications/XAMPP/xamppfiles/etc

sudo chflags nouchg my.cnf

But it doesn't work. I type my password and then when I open the file with the text editor it's still locked.

  • Are there any other way to unlock files?
  • Can I set the thread stack in xampp any other way than in the my.cnf file?

I'm running Mac OS 10.8.2

ls -l /Applications/XAMPP/xamppfiles/etc

drwxr-xr-x@ 16 root   admin    544 27 Feb  2010 extra
-rw-r--r--@  1 root   admin   3572 27 Feb  2010 freetds.conf
-rw-r--r--@  1 root   admin  17693 27 Feb  2010 httpd.conf
-rw-r--r--@  1 root   admin  17008 27 Feb  2010 httpd.conf.bak
-rw-r--r--@  1 root   admin    362 27 Feb  2010 locales.conf
-rw-r--r--@  1 root   admin  12958 27 Feb  2010 magic
-rw-r--r--@  1 root   admin  37486 27 Feb  2010 mime.types
-rw----rw-@  1 root   admin   2729  5 Feb 10:20 my.cnf
drwxr-xr-x@  4 root   admin    136 27 Feb  2010 openldap
lrw-r--r--   1 Oskar  admin     56 27 Feb  2010 openssl.cnf -> /Applications/xampp/xamppfiles/share/openssl/openssl.cnf
drwxr-xr-x@  4 root   admin    136 27 Feb  2010 original
-rw-r--r--@  1 root   admin   1630 27 Feb  2010 pear.conf
-rw-rw-r--@  1 root   admin  39774 27 Feb  2010 php.ini
-rw-r--r--@  1 root   admin    219 27 Feb  2010 pool.conf
-rw-r--r--@  1 root   wheel   2103 27 Feb  2010 proftpd.conf
-rw-rw-r--@  1 root   admin   1911 27 Feb  2010 proftpd.conf.orig
drwxrwxr-x@  3 root   admin    102 27 Feb  2010 ssl.crt
drwxrwxr-x@  3 root   admin    102 27 Feb  2010 ssl.key
-rw-rw-r--@  1 root   admin  23953 27 Feb  2010 webalizer.conf
-rw-r--r--@  1 root   admin  23930 27 Feb  2010 webalizer.conf.sample
drwxrwxr-x@  4 root   admin    136  5 Feb 10:20 xampp
share|improve this question
What do you mean by "locked"? Are you sure it's not just insufficient permissions of the text editor? What error is displayed? – Daniel Beck Feb 5 '13 at 9:57
I get no error. In the text editor it says locked at the top. I have write and read - permissions – Oskar Feb 5 '13 at 9:58
Can you edit (and save) the file with a command-line text editor like vim or emacs? What are the permissions for the folder? Could you provide the output of ls -l /Applications/XAMPP/xamppfiles/etc? – Daniel Beck Feb 5 '13 at 10:00
How would I edit it using emacs? – Oskar Feb 5 '13 at 10:03
up vote 1 down vote accepted

When you click the Locked in the file's title bar, a menu opens. Select Unlock. It will tell you if there's a reason it fails.


Fix that reason. In my example, I'm missing write permissions to the parent folder, and the editor requires those to perform atomic writes. To fix this specific error, run sudo chmod a+w /Applications/XAMPP/xamppfiles/etc, giving every account on your system write permission to that etc folder.

Alternatively, edit the file in a text editor that supports inline editing, such as vim or emacs. You'll find many tutorials on their basic use online.

share|improve this answer
Gives me exactly the same error. – Oskar Feb 5 '13 at 10:08
@Oskwish Updated answer. – Daniel Beck Feb 5 '13 at 10:11
Now mysql/phpmyadmin gives me this error: #1 - Can't create/write to file '/var/folders/cm/bvzmj0451s1863p1g1n72j900000gq/T/#sql555_4_2.MYI' (Errcode: 13) – Oskar Feb 5 '13 at 10:17
@Oskwish When you saved the file, the ownership and permissions were probably changed. You should change these to match what was there previously, just to be sure. Depending on what exactly you changed in the file, this could be a result of those changes as well. – Daniel Beck Feb 5 '13 at 10:22
Fixed the new error with sudo chmod 600 my.cnf – Oskar Feb 5 '13 at 10:22

Your Answer


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.