how to find mysql binary in redhat
Solution 1
It usually should be in the path already and can be executed with just calling mysql
in the shell.
If that's not working (and you have reason to expect the mysql
CLI binary to be installed), you can try to find it with find
:
find / -name mysql -type f
Example:
find / -name mysql -type f
/usr/bin/mysql
Solution 2
MySQL consists of two components, the MySQL server which is the actual database engine and the MySQL client, used to communicate with the database server from the command line.
The MySQL client is installed from the plain mysql
software package. If it isn't available (check with rpm -q mysql
) use yum install mysql
after which the mysql
command should available in your regular path or by it's default absolute path /usr/bin/mysql
.
Related videos on Youtube
Roy Hinkley
Updated on September 18, 2022Comments
-
Roy Hinkley over 1 year
I am working with a Redhat distribution. The network admin is inaccessible so I have no ability to request information.
Using bash, how do I find the mysql binary so that I can run sql commands?
mysql -u user -p password -bash: mysql: command not found
So they did not set up the path.
-
iSee almost 10 yearsAre you sure MySQL is installed? Try running
find /usr /opt /home -name mysql
-
Roy Hinkley almost 10 yearsYes I am. I can connect to it using an already establish workbench connection.
-
iSee almost 10 yearsI meant the client, not the server, as your question mentions a problem with the client, not with the server.
-
-
Roy Hinkley almost 10 yearsThank you - your
find / -name mysql -type f
worked. I will mark your answer asap. -
iSee almost 10 years@AndroidAddict, where was it?