Site not starting after system reset

I tried to replicate this and wasn’t successful, however I didn’t do a full system reset. Instead, I basically:

  1. Created a tarball of those folders
  2. Deleted the folders
  3. Quit Local
  4. Restored the folders
  5. Started Local and Accessed a site

When I take a closer look at the error message you provided, these lines stand out to me:

mysqladmin: [Warning] World-writable config file '/Users/aryanraj/Library/Application Support/Local/run/YA0dUFP44/conf/mysql/my.cnf' is ignored.
...
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

The /tmp/mysql.sock location is the default location for mysql. Local sites don’t use that default location, and instead use a socket location within the run folder which looks like:

~/Library/Application Support/Local/run/9H426W0MV/php/php-fpm.socket

I think what might be happening is that:

  1. Local tries to start mysql
  2. Because the config file is world-writable, Mysql doesn’t load the individual site configuration located at .../run/YA0dUFP44/conf/mysql/my.cnf, and so falls back to the default configuration using the default socket
  3. The default socket won’t line up with the socket needed for the individual site, so Local can’t fully start the site and an error is thrown.

I wonder what kind of file permissions you have, and if you need to adjust the permissions?

You can list the file permissions for all your sites by opening a terminal and running this find command:

find ~/Library/Application\ Support/Local/ -name 'my.cnf' -exec ls -alh {} \;

I think you’ll want to see lines that look like what’s on my computer (note the -rw-r--r-- part, aka “644 perms”):

If you have something different, like -rwxrwxrwx at the start of the lines, then I think you’ll want to reset those perms. To do this, ensure you still have a backup of these sites, quit Local, and then run this command within the terminal:

find ~/Library/Application\ Support/Local/ -name 'my.cnf' -exec chmod 644 {} \;

Can you take a look at those file permissions and see if running that command to set the files to 644 permissions helps? If you still have problems, can you provide the output of what those file permissions are?

1 Like