&tag(Homebrew/mysql);
brew install mysql
cp /usr/local/Cellar/mysql/5.6.10/support-files/my-default.cnf /usr/local/etc/my.cnf
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql.server start
mysqladmin -uroot password
brew tap homebrew/versions brew install mysql55
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
This formula is keg-only, which means it was not symlinked into /usr/local.
Conflicts with mysql, mariadb, percona-server, mysql-cluster, etc.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/mysql55/lib
CPPFLAGS: -I/usr/local/opt/mysql55/include
To have launchd start mysql55 at login:
ln -sfv /usr/local/opt/mysql55/*.plist ~/Library/LaunchAgents
Then to load mysql55 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
brew tap homebrew/versions brew install mysql55
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
This formula is keg-only: so it was not symlinked into /usr/local.
Conflicts with mysql, mariadb, percona-server, mysql-cluster, etc.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/mysql55/lib
CPPFLAGS: -I/usr/local/opt/mysql55/include
To have launchd start mysql55 at login:
ln -sfv /usr/local/opt/mysql55/*.plist ~/Library/LaunchAgents
Then to load mysql55 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
$ cp /usr/local/Cellar/mysql55/5.5.30/support-files/my-medium.cnf /usr/local/etc/my.cnf
[client] default-character-set=utf8 [mysqldump] default-character-set=utf8 [mysql] default-character-set=utf8 [mysqld] character-set-server=utf8
ln -sfv /usr/local/opt/mysql55/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist
$ brew versions mysql 5.6.10 git checkout 3bffe56 Library/Formula/mysql.rb 5.5.29 git checkout 336c976 Library/Formula/mysql.rb 5.5.28 git checkout 5825f62 Library/Formula/mysql.rb 5.5.27 git checkout 93aecfa Library/Formula/mysql.rb
$ cd /usr/local $ git checkout 336c976 Library/Formula/mysql.rb
$ brew install mysql
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysql_install_db:
mysql_install_db --help
and view the MySQL documentation:
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
* http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html
To run as, for instance, user "mysql", you may need to `sudo`:
sudo mysql_install_db ...options...
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 mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
$ cp /usr/local/Cellar/mysql/5.5.29/support-files/my-medium.cnf /usr/local/etc/my.cnf
$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents $ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ /usr/local/opt/mysql/bin/mysqladmin -uroot password