-1

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.

  • Run /root/opt/rh/mysql55/root/usr/bin/mysql -u root, what is the result? – Braiam Jul 21 '14 at 19:38
  • Did you run export PATH? – dchirikov Jul 21 '14 at 19:54
  • If I fully qualify the path for mysql, then the client utility starts. – Roy Hinkley Jul 21 '14 at 20:04
  • Why is it installed in root's subdir? Most users (including the mysql user) cannot read or search in root'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 by mysql:mysql and be done with it. – lornix Jul 22 '14 at 05:59
  • That's where the admin put it. – Roy Hinkley Jul 22 '14 at 11:05

1 Answers1

7

You should add only the path, not the mysql executable itself. PATH is list of directories, not files.

Try adding:

/root/opt/rh/mysql55/root/usr/bin/
cuonglm
  • 153,898