Home  >  Article  >  php教程  >  Three ways to permanently add environment variables in Linux

Three ways to permanently add environment variables in Linux

高洛峰
高洛峰Original
2016-12-15 17:04:492119browse

How to add /usr/local/mysql/bin as a system variable
Method 1:
vim /etc/profile Add at the end
PATH=/usr/local/mysql/bin:$PATH
export PATH

If it’s the one just now The modification will take effect immediately. You need to execute the following code

[root@CentOS ~]# source /etc/profile

Method 2:
cd /etc/profile.d
vim mysql.sh
PATH=/usr/local/mysql/ bin:$PATH
export PATH

If the modification just now takes effect immediately, you need to execute the following code

[root@CentOS ~]#source /etc/profile.d/mysql.sh



More For related articles on three methods of permanently adding environment variables in Linux, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn