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