A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To have launchd start mariadb at login:
mkdir -p ~/Library/LaunchAgents
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
Then to load mariadb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> Summary
🍺 /usr/local/Cellar/mariadb/10.1.12: 565 files, 131.5M
mysql.server restart
vim /usr/local/opt/mariadb/homebrew.mxcl.mariadb.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.mariadb</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/mariadb/bin/mysqld_safe</string>
<!--string>--bind-address=127.0.0.1</string-->
<string>--bind-address=0.0.0.0</string>
<string>--datadir=/usr/local/var/mysql</string>
<string>--expire_logs_days=7</string>
</array>
<key>RunAtLoad</key> <true/>
<key>WorkingDirectory</key>
<string>/usr/local/var</string>
<key>Disabled</key> <false/>
<key>OnDemand</key> <false/>
<key>UserName</key>
<string>hoge</string>
</dict>
</plist>
sudo chown root /usr/local/opt/mariadb/homebrew.mxcl.mariadb.plist
sudo ln -sfv /usr/local/opt/mariadb/*.plist /Library/LaunchDaemons
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.mariadb.plist