Local Community

Can't connect to local MySQL server through socket - Headless setup fails and removes all files

Hi all,

My setup is:
Mac Mini macOS Mojave V 10.14.6
Local V 6.1.5
Atlas Add-on V 1.3.0
Web server: nginx
PHP Version: 7.4.1
DB: MySQL 8.0.16

I am unable to create a Headless setup as the setting up process fails with this error:

`Error: Error: Command failed: /Applications/Local.app/Contents/Resources/extraResources/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqladmin --password= ping
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
amysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/Users/bc-dev-2/Library/Application Support/Local/run/ztt1K1R6D/mysql/mysqld.sock’ (2)’
Check that mysqld is running and that the socket: ‘/Users/bc-dev-2/Library/Application Support/Local/run/ztt1K1R6D/mysql/mysqld.sock’ exists!

at ChildProcess.exithandler (child_process.js:317:12)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:467:12)
at maybeClose (internal/child_process.js:1048:16)
at Socket.<anonymous> (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Socket.EventEmitter.emit (domain.js:467:12)
at Pipe.<anonymous> (net.js:673:12)`

Anyone encountered this issue?

I’ve sometimes seen this type of error and don’t know exactly why it happens. Notice the (2) part of the error? That’s like when a file already exists, the OS is trying to name it something different.

I think what might be happening is that something isn’t shutting down cleanly and so that socket already exists when it’s trying to be re-created.

Can you try a restart of the computer so that those old sockets are cleaned up?

Also, do you get similar errors when trying MySQL 5.7?