how-do-i-set-mysql-environment-variable-in-ubuntu
how-can-i-use-an-environment-variable-in-the-mysql-console
setting-environment-variables
So I installed XAMPP (in Ubuntu), and it was successful,
the location of MYSQL is on, /opt/lampp/bin/mysql, and so I have to include the entire path to access mysql as seen below:
Problem
$/opt/lampp/bin/mysql -u root -p
And it can login.
But using just "mysql" isn't working; it says not found.
Can you give me an idea on how to set env't variable for mysql?
New in Ubuntu. help? :(
SOlution
4
in your home directory there's a file called .bash_profile (use ls -la to see it because files starting with . are by default hidden
There will probably already be a line similar to this one:
PATH=$PATH:$HOME/bin
Change it to
PATH=$PATH:$HOME/bin:/opt/lampp/bin/
============OR================
In root vi .bashsrc
export PATH=$PATH:/opt/lampp/bin
====================or===================
other than root user
Set db name,username and pwd
=================================
Top comments (0)