Solved

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

Posted on 2007-03-26
33
2,647 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 87

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
 
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 87

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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 87

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 87

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now