Home > Database > Mysql Tutorial > How to add mysql to environment variables

How to add mysql to environment variables

王林
Release: 2020-09-29 13:53:13
Original
4723 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template