I am having similar problems with MariaDB on a fresh and clean install of High Sierra.
==> Pouring mariadb-10.2.11.high_sierra.bottle.tar.gz Warning: The post-install step did not complete successfully You can try again using `brew postinstall mariadb`
On doing this I get
==> Postinstalling mariadb Error: Permission denied @ dir_s_mkdir - /tmp/homebrew20171130-15621-18561us
If I check brew services I get:
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mariadb started Andrew /Users/andrew/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php71 started root /Library/LaunchDaemons/homebrew.mxcl.php71.plist
It seems it has started and running but when I connect to it
mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
stuck, any ideas?