Fresh install of Homebrew. Install mariadb. Run brew services start mariadb. Unable to connect to MariaDB. brew doctor does not report any problems. LaunchAgent appears correctly installed.
Noticed that "group" is admin for the mysqld_safe binary in /usr/local/opt/mariadb/bin.
Added error output to LaunchAgent plist file and this is in file:
/usr/local/opt/mariadb/bin/mysqld_safe: line 144: /usr/local/var/mysql/Taylors-MacBook.attlocal.net.err: Permission denied
That binary is owned by Taylor and group is admin.
Same problem for me, linking MariaDB then unlinking and relinking MySQL also caused MySQL to stop working. Had to recursively change permissions on /usr/local to get things working again but not confident that was necessarily the proper fix.
Yeah, I also had to run sudo chown -R Taylor/staff /usr/local to things to work out of the box.
This was on a fresh laptop so not sure this is expected Homebrew / Maria behavior to have to run this command to get things working.
Linking MariaDB:

Changing permissions gets it to run:

Unlinking MariaDB then relinking it causes same issues until I fix the permissions:

Now even changing the permissions won't allow MariaDB to work properly.
@adamwathan
Chances are the install process of mariadb did not complete successfully because mysql was still linked. Maybe brew update && brew services stop mysql && brew unlink mysql && brew reinstall mariadb could solve your issue
Or else:
/tmp/mysql.sock file really exist ?/tmp/mysql.sock ?Hey thanks @lucasmichot ! Still getting the error after unlinking MySQL, reinstalling MariaDB and restarting:

MariaDB appears to be "running" according to brew services:

/tmp/mysql.sock does not actually exist while MariaDB is running:

When I unlink MariaDB and relink and restart MySQL, that file does exist:

Anyone have any ideas on this?
Same problem for me, linking MariaDB then unlinking and relinking MySQL also caused MySQL to stop working. Had to recursively change permissions on /usr/local to get things working again but not confident that was necessarily the proper fix.
Yeah, I also had to run sudo chown -R Taylor/staff /usr/local to things to work out of the box.
This was on a fresh laptop so not sure this is expected Homebrew / Maria behavior to have to run this command to get things working.
That's expected behaviour, our installer does that for you.
Don't rely on brew services to see if it is running or not: use ps aux | grep mysql (or the mariadb equivalent). Try to use mysql.server start or mysqld rather than brew services to start it and check the failure output.
We'll accept PRs for this but we're not actively working on it at this time.
FWIW in case anyone finds this down the road (future me included 馃槉), the thing that seems to reliably work for me when trying to switch between MariaDB and MySQL is to delete/rename/backup /usr/local/var/mysql before switching to the other database.
It seems like the installer notices those files and tries to preserve them, but something in there is not compatible between the two databases.
I can reliably switch whenever I want as long as /usr/local/var/mysql doesn't exist when installing the other DB.
For example, this works every time:
brew services stop mysql
brew uninstall mysql
mv /usr/local/var/mysql /usr/local/var/mysql_bu
brew install mariadb
brew services start mariadb
@adamwathan these steps worked. Thanks!
For those who get the mysql.sock not found error. See if mysqld is running.
After updating Valet, all went on a roadtrip to hell. The above made the dev-il go away.
I did a clean remove via this guide and then reinstalled:
https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks
Most helpful comment
FWIW in case anyone finds this down the road (future me included 馃槉), the thing that seems to reliably work for me when trying to switch between MariaDB and MySQL is to delete/rename/backup
/usr/local/var/mysqlbefore switching to the other database.It seems like the installer notices those files and tries to preserve them, but something in there is not compatible between the two databases.
I can reliably switch whenever I want as long as
/usr/local/var/mysqldoesn't exist when installing the other DB.For example, this works every time: