zoukankan      html  css  js  c++  java
  • Install mysql on Mac

    Install mysql on Mac

    这里使用 homebrew 安装。

    安装命令:

    brew install mysql 
    

    image-20201108222722981

    安装之后的命令,留一个备份。
    Pruned 1 symbolic links and 2 directories from /usr/local
    ==> Caveats
    ==> openssl@1.1
    A CA file has been bootstrapped using certificates from the system
    keychain. To add additional certificates, place .pem files in
      /usr/local/etc/openssl@1.1/certs
    
    and run
      /usr/local/opt/openssl@1.1/bin/c_rehash
    
    openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
    because macOS provides LibreSSL.
    
    If you need to have openssl@1.1 first in your PATH run:
      echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
    
    For compilers to find openssl@1.1 you may need to set:
      export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
      export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
    
    ==> protobuf
    Emacs Lisp files have been installed to:
      /usr/local/share/emacs/site-lisp/protobuf
    ==> mysql
    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
    

    相关命令:

    启动:    mysql.server start
    停止:    mysql.setver stop 
    登录:    mysql -u root  ;  登录root用户。
    选择一个database :  use  erwa 
    查看所有的database:  show databases 
    
    查看这个命令是干什么的:
    man mysql 
    

    插入成功截图

    image-20201110081612310

    TOPS:

    1、更新homebrew的时候遇到了个小问题,卡了半天之后提示没有权限。

    You should change the ownership of these directories to your user.

    这里根据他的提示输入命令,然后提示输入当前用户的密码,给 赋予权限,然后重新执行OK。

    image-20201108221619308

    2、登录的时候没找到默认的初始密码。 尝试了一下不输入密码后,确实登录成功了。

  • 相关阅读:
    java:输出流程printStream
    phalcon 连接多个数据库 phalcon multi-database
    Selenium Webdriver元素定位的八种常用方法
    adb push ,adb pull和adb install的区别
    Java将数据写进excel
    Java接口和抽象类的区别
    深入理解Java的接口和抽象类
    Java内存解析 程序的执行过程
    bit,byte,char,位,字节,字符 的区别
    java static成员变量方法和非static成员变量方法的区别 ( 二 )
  • 原文地址:https://www.cnblogs.com/wobushitiegan/p/14032902.html
Copyright © 2011-2022 走看看