How to add MySQL to environment variables

Source: Internet
Author: User

Environment:

In the LAMPP environment of your own installation, you must specify a path to access the database when using MySQL, which is too cumbersome. We can solve this problem by adding MySQL to the environment variable (mysql execution path/opt/lampp/bin)

Method One:

1. The Prime Minister opens the/etc/profile file and adds the following command at the end of the file:

Export Path=/opt/lampp/bin: $PATH

2. Execute the order source/etc/profile make it effective

3, after the completion of the execution we can be in any path through the mysqsl-u root-p command to log in the data

Method Two:

Direct Run command export path= $PATH:/opt/lampp/bin, using this method, only valid for the current session, that is, each time the system is logged out or logged off, the PATH setting will be invalidated, but only temporarily effective.

Method Three:

Execute VI ~/.bash_profile Modify the PATH line in the file, add/opt/lampp/bin to path= $PATH: after $HOME/bin row
This method only takes effect on the currently logged on user

Reference Documentation:

Http://www.linuxidc.com/Linux/2015-01/111727.htm

How to add MySQL to environment variables

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.