environment variable collation of CentOS

Source: Internet
Author: User

environment variable collation of CentOS

MySQL used on CentOS always needs to execute commands in the installation directory, otherwise it will prompt command not fount. MySQL installation directory for/usr/local/mysql, now to collate the environment variables under CentOS.


Method one. Direct Run command Exprot path= $PATH:/usr/local/mysql/bin

Using this method is only valid for the current session, that is, when the system is logged out or logged off, it becomes invalid.


Method Two. Execute VI ~/.bash_profile Modify the path line in the file,

Modified to Path= $PATH:/$HOME/bin:/usr/local/mysql/bin

The modification takes effect for the user.


Method Three. Modify the/etc/profile file, which is permanently active after restarting the system

Export path= $PATH:/usr/local/mysql/bin

Executes the command source/etc/profile to make it effective, and you can see if the add succeeds through the Echo $PATH command.

environment variable collation of CentOS

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.