how to find mysql binary in redhat

14,353

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.

Share:
14,353

Related videos on Youtube

Roy Hinkley
Author by

Roy Hinkley

Updated on September 18, 2022

Comments

  • Roy Hinkley
    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
      iSee almost 10 years
      Are you sure MySQL is installed? Try running find /usr /opt /home -name mysql
    • Roy Hinkley
      Roy Hinkley almost 10 years
      Yes I am. I can connect to it using an already establish workbench connection.
    • iSee
      iSee almost 10 years
      I meant the client, not the server, as your question mentions a problem with the client, not with the server.
  • Roy Hinkley
    Roy Hinkley almost 10 years
    Thank you - your find / -name mysql -type f worked. I will mark your answer asap.
  • iSee
    iSee almost 10 years
    @AndroidAddict, where was it?