How do I install command line MySQL client on mac?

前端 未结 14 2256
失恋的感觉
失恋的感觉 2020-12-22 15:58

I want to install the MySQL client for the command line, not a GUI. I have searched over the web but only found instructions on installing the MySQL server.

14条回答
  •  余生分开走
    2020-12-22 16:12

    If you have already installed MySQL from the disk image (dmg) from http://dev.mysql.com/downloads/), open a terminal, run:

    echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile
    

    then, reload .bash_profile by running following command:

     . ~/.bash_profile
    

    You can now use mysql to connect to any mysql server:

    mysql -h xxx.xxx.xxx.xxx -u username -p
    

    Credit & Reference: http://www.gigoblog.com/2011/03/13/add-mysql-to-terminal-shell-in-mac-os-x/

提交回复
热议问题