Add the MySQL command to the MAC environment variable in the terminal directly with the MySQL command

Source: Internet
Author: User
  1. The first thing to know is what kind of shell you use for Mac OS x, using commands

    Echo $SHELL

    If the output is: CSH or TCSH, then you are using C Shell.

    If the output is: bash,sh,zsh, then your use may be a variant of the Bourne shell.

    Before Mac OS X 10.2, the default is C Shell.

    The default is Bourne Shell after Mac OS X 10.3.

  2. Open terminal, input: cd ~

    Will enter the ~ folder

  3. Then type: sudo vim. bash_profile

    Enter the root user password to execute. sudo uses the root user to modify the environment variable file.

  4. Enter at the bottom of the document: Export Path=${path}:/usr/local/mysql/bin

    Then ESC exits the insert state and enters at the bottom: Wq save to exit.

  5. Input: source. bash_profile

    Enter execution, run environment variable.

  6. Then enter MySQL and you can use it.

Add the MySQL command to the MAC environment variable in the terminal directly with the MySQL command

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.