macbook install mysql

來源:互聯網
上載者:User

標籤:cell   .gz   class   pen   var   login   nss   ash   launch   

  1. 安裝Homebrew,詳細步驟參見Homebrew官網。
  2. brew doctor確認brew在正常工作。
  3. brew update更新包。
  4. brew install mysql 安裝mysql。log如下:

    ==> Installing dependencies for mysql: openssl
    ==> Installing mysql dependency: openssl
    ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2l.sierra.bottle.tar.gz
    ######################################################################## 100.0%
    ==> Pouring openssl-1.0.2l.sierra.bottle.tar.gz
    ==> Using the sandbox
    ==> Caveats
    A CA file has been bootstrapped using certificates from the SystemRoots
    keychain. To add additional certificates (e.g. the certificates added in
    the System keychain), place .pem files in
    /usr/local/etc/openssl/certs

    and run
    /usr/local/opt/openssl/bin/c_rehash

    This formula is keg-only, which means it was not symlinked into /usr/local,
    because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

    If you need to have this software first in your PATH run:
    echo ‘export PATH="/usr/local/opt/openssl/bin:$PATH"‘ >> ~/.bash_profile

    For compilers to find this software you may need to set:
    LDFLAGS: -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

    ==> Summary
    ?? /usr/local/Cellar/openssl/1.0.2l: 1,709 files, 12.2MB
    ==> Installing mysql
    ==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.18_1.sierra.bottle.tar.gz
    ######################################################################## 100.0%
    ==> Pouring mysql-5.7.18_1.sierra.bottle.tar.gz
    ==> /usr/local/Cellar/mysql/5.7.18_1/bin/mysqld --initialize-insecure --user=chenxu --basedir=/usr/local/Cellar/mysql/5.7.18_1 --datadir=/usr/local/var/mysq
    ==> 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
    ==> Summary
    ?? /usr/local/Cellar/mysql/5.7.18_1: 321 files, 232.9MB

  5. 後台啟動服務:brew services start mysql 
  6. 前台啟動服務:mysql.server start
  7. 安裝後的mysql無root密碼,登入mysql:mysql -u root -p

macbook install mysql

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.