XAMPP Runs As User Nobody on Mac
During my recent macbook pro upgrade, I had a sweet time automatically migrating my entire old macbook to the new one using Migration Assistant. The experience could not have been smoother - all my data and applications were moved without a hitch. Couple apps asked to re-enter serial numbers, but that’s all.
However when I tried to start my XAMPP-packaged MySQL today (I usually develop on a Linux box, so do not use local MySQL that often) - it would not start. After some digging around I noticed that permissions on the MySQL data folder in /Applications/xampp/xamppfiles/var were wrong - it was owned by “admin” and MySQL could not write in it. I quickly changed ownership to the mysql user (that was present on my computer), but to my surprise - that did not help. After some more digging, I found that, apparently, XAMPP runs MySQL as “nobody”, just like it does Apache. Somewhat uncommon, but oh well.
Following three commands fixed my after-migration problem:
sudo chown -R nobody:admin mysql
sudo chmod -R 775 mysql