mysql connecting problem

Discussion regarding the installation and configuration of Linux distributions.
Post Reply
mohdali2
Havaldaar
Posts: 125
Joined: Sun Jan 26, 2003 4:54 pm

mysql connecting problem

Post by mohdali2 »

I recently installed mysql database from redhat linux 7.2 distribution in form of RPM package but when I tried to connect the test database using

mysql -utest

The following error message displayed:

Error 2002:

Can't connect to local mysql server through socket "/var/lib/mysql/mysql.sock" (111)

If anyone knows please help me solve the problem

Regards
Muhammad Ali
adilhafeez
Cadet
Posts: 2
Joined: Wed Mar 05, 2003 6:04 pm
Contact:

Post by adilhafeez »

it seems that you havent started the mysql daemon
to start mysql type following command
login as super user (root)

service mysqld start
or
/etc/rc.d/init.d/mysqld start
gh4z4nf4r
Naik
Posts: 65
Joined: Mon Oct 14, 2002 3:51 pm
Location: Wah Cantt
Contact:

Post by gh4z4nf4r »

aoa,

mohdali2
i had the same error when i installed mysql recently. then i gave all those commands like
mysqld start
mysqld start &
and one or more type that was given in the howto
but that did nothing for me .......dont know why because its the standard way to do it .
then what i did in the end was to start mysqld from serviceconfigurator and then every thing worked fine ..i got my connection and was abe to connect to database through mycc.
that was all how it went i still dont know why
mysqld start didnt worked
Kdaemon
Naib Subedar
Posts: 346
Joined: Sat Nov 30, 2002 12:22 pm
Location: Islamabad. GPS: LHR

mysqld

Post by Kdaemon »

I also had same problem
i first started mysqld
that created that socket for listening
mrkkhattak
Site Admin
Posts: 285
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi
Contact:

Post by mrkkhattak »

Assalamualaikum,

Oh ...

I too did the same gh4z4nf4r (started mysql from service configurator or webmin - both worked fine) . after that I added mysql to be run at startup (added it through service configurater). it worked fine :-)

regards,

-Meraj
gh4z4nf4r
Naik
Posts: 65
Joined: Mon Oct 14, 2002 3:51 pm
Location: Wah Cantt
Contact:

Post by gh4z4nf4r »

hi,
so do any one know why its not starting with the command line
fawad
Site Admin
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
Location: Addison, IL
Contact:

Post by fawad »

gh4z4nf4r,
It's usually recommended to use the init script for starting and stopping daemons instead of doing that directly. On redhat:

Code: Select all

su -
service mysql restart
will restart the service in an orderly fashion
Post Reply