I am working with a Redhat distribution. Mysql is installed with the binary in the following path:
/root/opt/rh/mysql55/root/usr/bin/mysql
Furthermore, the environmental variable PATH echos:
echo $PATH
/root/opt/rh/mysql55/root/usr/bin/mysql:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/opt/rh/mysql55/root/usr/bin/mysql
The server has been restarted but if I type
mysql
into bash it returns the following:
# mysql -u root
-bash: mysql: command not found
Please advise
EDIT
Altered PATH EV to
/root/opt/rh/mysql55/root/usr/bin
using
export mysql /opt/rh/mysql55/root/usr/bin
export PATH ${mysql}:${PATH}
Still get command not found
After rebooting the server, echo $PATH is now:
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
So, the path to mysql is gone.
/root/opt/rh/mysql55/root/usr/bin/mysql -u root
, what is the result? – Braiam Jul 21 '14 at 19:38export PATH
? – dchirikov Jul 21 '14 at 19:54root
's subdir? Most users (including themysql
user) cannot read or search inroot
's subdir. Probably works when you type the path yourself since you're already root. Your directory structure implies it would work just dandy in/opt/rh/...
... move it there, make owned bymysql:mysql
and be done with it. – lornix Jul 22 '14 at 05:59