• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 843
  • Last Modified:

trying to connect to mysql server through putty and getting mysql command not found

I am trying to connect to mysql server through putty and getting mysql command not found..
All the mysql client utilities are present in the following directory...
/global/db/mysql-enterprise-gpl-5.1.39-solaris10-sparc-64bit/bin

I log in through putty supplying the user name, password and ip address etc and then trying to access the mysql server at the shell prompt -
hqdb1% mysql -u **** - p -> gives mysql command not found error.
mysql.doc
0
Jsara
Asked:
Jsara
  • 4
  • 3
  • 2
1 Solution
 
deisrobinsonCommented:
Is the mysql server actually started?
0
 
JsaraAuthor Commented:
yes it is up and running and is a live database..
0
 
deisrobinsonCommented:
Is mysql/bin  or something similar in your environment path?
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
deisrobinsonCommented:
If not use this command:
PATH="$PATH:/usr/local/mysql/bin"
0
 
JsaraAuthor Commented:
I am able to connect to the same server through command prompt fine.
Using putty I am able to log in to the machine but not able to connect to the server. While connecting through putty I am in the bin path - not using any environment path variable.
0
 
JsaraAuthor Commented:
I don't have rights to set the path variable and all...
0
 
arnoldCommented:
When you are in the shell, run which mysql.
if it is not found, try /usr/local/bin/mysql or /global/db/mysql-enterprise-gpl-5.1.39-solaris10-sparc-64bit/bin/mysql
depending on the shell; bash,sh
export PATH=/global/db/mysql-enterprise-gpl-5.1.39-solaris10-sparc-64bit/bin:$PATH
and mysql should work.
you can add this statement to .bashrc .login .profile.
note the last $PATH is to include the PATH as defined/provided by the system.
0
 
JsaraAuthor Commented:
ok we are a small shop, I am not a dba basically..
if I type  in /global/db/mysql-enterprise-gpl-5.1.39-solaris10-sparc-64bit/bin/mysql
it gives me the message - mysql command not found

if I type  in /global/db/mysql-enterprise-gpl-5.1.39-solaris10-sparc-64bit/bin and enter 'which mysql' then I get the message 'no mysql in /usr/bin

What should I do next.
0
 
arnoldCommented:
Your PATH variable only incudes /usr/bin

try the following:
PATH=/usr/local/bin:/usr/local/mysql/bin:/global/db/mysql-enterprise-gpl-5.1.39-solaris10-sparc-64bit/bin:/opt/bin:/opt/mysql/bin:/usr/mysql/bin:$PATH
export PATH
now what does running which mysql return?
You should also check with your sysadmin to see whether you are allowed to run mysql.
I do not know how your Solaris setup is.
The sysadmin can quickly update your profile settings to allow for mysql access.
pkginfo | grep -i mysql will check whether mysql is installed as a SUN package.
there is a way using pkginfo -l mysql_packagename | grep mysql to see where the mysql program is installed.  Then add it into the PATH variable as the example above shows.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now