Mac下安裝MySQL

Mac下安裝MySQL簡單到想哭,基本上就是brew搜索一下,安裝,啟動,即可。

$ brew install mysql
$ mysql.server start

如果想停止,可以使用:

$ mysql.server stop

以下是我的機器上,brew search/info的輸出,尤其是最后的啟動命令,很有用。

bash-3.2$ brew search mysql
automysqlbackup              mysql-cluster                mysql-sandbox                mysql@5.5
mysql ?                      mysql-connector-c            mysql-search-replace         mysql@5.6
mysql++                      mysql-connector-c++          mysql-utilities              mysqltuner
caskroom/cask/mysql-connector-python   caskroom/cask/sqlpro-for-mysql         caskroom/cask/navicat-for-mysql
caskroom/cask/mysql-utilities          caskroom/cask/mysql-shell
bash-3.2$ brew info mysql
mysql: stable 5.7.19 (bottled)
Open source relational database management system
https://dev.mysql.com/doc/refman/5.7/en/
Conflicts with:
  mariadb (because mysql, mariadb, and percona install the same binaries.)
  mariadb-connector-c (because both install plugins)
  mysql-cluster (because mysql, mariadb, and percona install the same binaries.)
  mysql-connector-c (because both install MySQL client libraries)
  percona-server (because mysql, mariadb, and percona install the same binaries.)
/usr/local/Cellar/mysql/5.7.19 (322 files, 233MB) *
  Poured from bottle on 2017-07-24 at 19:26:40
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mysql.rb
==> Dependencies
Build: cmake ?
Required: openssl ?
==> Requirements
Required: macOS >= 10.7 ?
==> Options
--with-archive-storage-engine
    Compile with the ARCHIVE storage engine enabled
--with-blackhole-storage-engine
    Compile with the BLACKHOLE storage engine enabled
--with-debug
    Build with debug support
--with-embedded
    Build the embedded server
--with-local-infile
    Build with local infile loading support
--with-test
    Build with unit tests
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

To have launchd start mysql now and restart at login:
  brew services start mysql
Or, if you don't want/need a background service you can just run:
  mysql.server start
最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容