hi friends,

I'm trying to install mysql on linux through rpm. I have install it & when I'm I enter the command

mysqladmin -u root -p create mydb

its showing
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

so what is the problem. can anyone tell me. PLZ.

when i;m trying to connect its showing

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

Recommended Answers

All 10 Replies

what distor do you have?
in Mandriva use urpmi, Suse there is Yast or zypper ...et al

urpmi mysql

what distor do you have?
in Mandriva use urpmi, Suse there is Yast or zypper ...et al

urpmi mysql

Hi there,

I'm using centOS. so any idea ?

what distor do you have?
in Mandriva use urpmi, Suse there is Yast or zypper ...et al

Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

Probably your mysql service 'mysqld' is not running...
Check with...

service mysqld status

If not running, start with... (as root)

service mysqld start

To always activate the service on boot...

chkconfig mysqld on

On Fedora systems (CentOS is alike) you can activate via the Gnome menu: System - Administration - Services

still not working

what distor do you have?
in Mandriva use urpmi, Suse there is Yast or zypper ...et al

how do you install other stuffs like VLC media ?

Have you set a root password for MySQL? In a standard installation, the root password is empty. You first have to set it.

mysqladmin -u root password NEWPASSWORD

Check to see if you have the server and not just the client installed.

yum list | grep mysql

will list all of the packages and you can see what is installed. My centOS 5 systems listed the following:
[root@srvr3 ~]# yum list | grep mysql
mysql.i386 5.0.77-4.el5_4.1 installed
mysql.x86_64 5.0.77-4.el5_4.1 installed
mysql-bench.x86_64 5.0.77-4.el5_4.1 installed
mysql-devel.i386 5.0.77-4.el5_4.1 installed
mysql-devel.x86_64 5.0.77-4.el5_4.1 installed
mysql-server.x86_64 5.0.77-4.el5_4.1 installed
perl-DBD-mysql.x86_64 4.013-1.el5.rf installed
php-mysql.x86_64 5.1.6-24.el5_4.5 installed

hey thanx to everyone for helping me to install mysql on linux successfully.

Also, in case anyone happens to stumble across this thread in google, that /var/lib/mysql/mysql.sock error also occurs when the process cant get enugh memory (256mb minimum, preferably 512mb+)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.