Home  >  Article  >  Database  >  How to add mysql to environment variables

How to add mysql to environment variables

王林
王林Original
2020-09-29 13:53:134657browse

How to add mysql to the environment variable: 1. Open the /etc/profile configuration file; 2. Add the configuration [export PATH=/opt/lampp/bin:$PATH]; 3. Execute [source / etc/profile] command to make the configuration take effect.

How to add mysql to environment variables

Background:

In the lamp environment installed by yourself, when using mysql, you must specify the path to enter the database, which seems too much trouble. We can solve this problem by adding mysql to the environment variable (mysql execution path/opt/lampp/bin).

(Recommended tutorial: mysql tutorial)

Specific method:

1. First open the /etc/profile file and add the following at the end of the file Command:

export PATH=/opt/lampp/bin:$PATH

2. Execute the command source /etc/profile to make the configuration take effect.

3. After the execution is completed, we can log in to the database through the mysqsl -u root -p command in any path.

Related recommendations: php training

The above is the detailed content of How to add mysql to environment variables. For more information, please follow other related articles on 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
Previous article:How to view help in mysqlNext article:How to view help in mysql