Solved

/usr/bin/mysql: No such file or directory

Posted on 2007-03-26
33
3,017 Views
Last Modified: 2008-01-09
I can start MySQL using

/sbin/service mysql start

but if I try other things like entering "mysql" at a prompt, I get
/usr/bin/myql: No such file or directory

when I do a locate mysql
the directory i notice is "/var/lib/mysql"

so how do I go about fixing this problem?
0
Comment
Question by:coldchillin
  • 17
  • 9
  • 4
  • +1
33 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 18794901
please run these and post the results

find / -name isql -print
echo $PATH
0
 
LVL 88

Expert Comment

by:rindi
ID: 18794950
You might have to run those commands as root or possibly as the user "mysql".
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18795754
user mysql does not have permission

as root:

the find / -name sql -print
produced nothing

/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/rdeleon/bin
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:coldchillin
ID: 18795878
i'm also looking for mysql.so but all i can find is mysql.sock - maybe they are the same file? i say this because the mysql.sock file is also in /var/lib/mysql/
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 18795902
if you ran what you typed the first command was wrong

find / -name sql -print should be find / -name isql -print (isql not sql)
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 18795912
scrub that  do

ls -l /uns/bin/mysql

thats where it is on my system

0
 
LVL 4

Expert Comment

by:mjutras
ID: 18796049
Did you check your my.cnf to be sure all paths are correct (usually in /etc/my.cnf)
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18796139
I typed the command correctly in the terminal, just not here.

I do not even have a mysql folder in /usr/bin

I started the mysql service
/sbin/service mysql start

but i could not find a my,cnf
updatedb
locate my.cnf

0
 
LVL 88

Expert Comment

by:rindi
ID: 18796202
what is your distro and how did you install mysql?
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18796344
I'm using CentOS 4.3
I went to mysql.org > 5.0 > rpm and downloaded the
MySQL-server-5.0.37-0.i386.rpm along with other accompanying files (headers. libraries, shared)

then used
rpm -e <packagename> to remove them

I now have downloaded 4.1.tar.gz
tar xvzf xxxxxx.tar.gz
./configure

It says that there isn't any configuration that needs to be done. but i don't know if i have started mysql
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18796352
I still don't have a my.cnf file
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18796383
after a ./configure you need to do those commands in the same directory where you untared the files:

make
make install

and then you will be able to start it!
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18796459
well i downloaded the tar in the /tmp folder, so it was extracted in
/tmp/mysql-standard-4.1.22-pc-linux-gnu-i686

make
make: *** No targets specified and no makefile found Stop.
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18796496
dont forget the :

./configure

and then:

make
make install
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18796516
In fact here's what it does:

./configure
# It create the configuration for building the sources and check for libraries dependencies
make
# it create installation script with values defined in configure
make install
# it compile and install where it needs to be, create Environment vars, set startup scripts and sometimes start the required / installed daemons
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18796583
./configure
excerpts:

"To help you a bit, I am now going to create the needed MySQL databases and start the MySQL Server for  you...
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system...
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin - u root -h localhost.localdomain password 'new-password'..."

then i execute the "make" command and I still get the above error
0
 
LVL 88

Expert Comment

by:rindi
ID: 18798002
Why didn't you use the centos repository to install mysql?

yum install mysql.

This takes care of all dependencies, no compiling needed, and most of the setup is already done...
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18800699
I was trying to put 5.0 on with CentOS but ran into a lot of trouble. I think the shared libraries/directories are different, and you have to do xyz to get it to work, and I didn't, so I finally just decided to go to 4.1. I am just going to try that....but...I think I had problems with that before, too.
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18800914
Ok, I did the yum install mysql

How do I start MySQL to verify it worked?

I get:

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

i did an updatedb and locate mysql.sock and I came up with nothing
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18801504
You tried

/sbin/service mysql start

?
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18802684
yes, yes i did

here's my error:

mysql: unrecognized service

0
 
LVL 4

Accepted Solution

by:
mjutras earned 500 total points
ID: 18802775
is there any

/etc/init.d/mysqld

?

if so try

/etc/init.d/mysqld start
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18803495
both
/etc/init.d/mysqld start
and
/etc/init.d/mysql start

No such file or directory
0
 
LVL 88

Expert Comment

by:rindi
ID: 18803519
What files do you have in /etc/init.d?
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18810062
quite a few, what am i looking for? Nothing with mysql, but there is httpd
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18810091
acpid                 dovecot     kudzu           pand             smb
anacron               dund        lm_sensors      pcmcia           snmpd
apmd                  firstboot   mdmonitor       portmap          snmptrapd
arptables_jf          functions   mdmpd           psacct           spamassassin
atd                   gpm         messagebus      rawdevices       squid
auditd                haldaemon   microcode_ctl   readahead        sshd
autofs                halt        named           readahead_early  syslog
BlueDragon_Server_JX  hidd        netdump         rhnsd            tux
bluetooth             httpd       netfs           rpcgssd          vncserver
cpuspeed              innd        netplugd        rpcidmapd        winbind
crond                 ipmi        network         rpcsvcgssd       xfs
cups                  iptables    NetworkManager  rwhod            xinetd
cups-config-daemon    irda        nfs             saslauthd        ypbind
dc_client             irqbalance  nfslock         sendmail         yum
dc_server             isdn        nscd            single
diskdump              killall     ntpd            smartd
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18810141
If you redo

yum install mysql

does it show you that its already installed or is there any error message?
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18810248
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18815186
I just reaslized that I was helping the same guy on both tickets...

http://www.experts-exchange.com/OS/Linux/Q_22473131.html

Now that clarify a couple of things!
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18816684
Unfortunately it's not getting me anywhere!
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18817321
i'm not sure where exactly the problem/fis was, but i used the GUI and CentOs 4.3 Distro CDs to install more MySQL Packages and did

/etc/init.d/mysql start

and IT WORKED!
0
 
LVL 1

Author Comment

by:coldchillin
ID: 18817342
One question, throughout the entire process, I  have never successfully ran
./configure
make
or
make install

does it matter, or is that only when using binaries?
0
 
LVL 4

Expert Comment

by:mjutras
ID: 18817899
it doesnt matter if you used your system package manager or any binaries. This is used to compile and install from sources
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Ubuntu Apache Webserver - File Permissions 5 58
Linux script delete files 3 47
Wifi connection to laptop without router windows 10 11 37
Disabling security updates Ubuntu 3 25
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question