Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
Hi All,
I'm getting the following error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' can anyone provide me this file?? Thanks |
If your file my.cnf (usually in the etc folder) is correctly configured with
socket=/var/lib/mysql/mysql.sock you can check if mysql is running with the following command: # mysqladmin -u root -p status try changing your permission to mysql folder. If you are working locally, you can try: # sudo chmod -R 777 /var/lib/mysql/ And there is also a quick workaround, try using the local ip address (127.0.0.1) instead of 'localhost' in mysql_connect(). This "forces" php to connect through TCP/IP instead of a unix socket. And also check the logs, /var/log/mysql |
You please also check this solved issue :
http://wordpressapi.com/2011/02/03/s...lmysql-sock-2/ http://corpocrat.com/2008/05/16/fix-...ysqlmysqlsock/ this might solve your problem. |
Quote:
Hi Arya, mysql folder is not availbale in "/var/lib" and i am not getting the below option Code:
And there is also a quick workaround, try using the local ip address (127.0.0.1) instead of 'localhost' in mysql_connect(). This "forces" php to connect through TCP/IP instead of a unix socket. |
Quote:
|
Tried the below command
Code:
[root@TEST2 installables]# rpm -ivh MySQL-server-5.5.11-1.rhel5.x86_64.rpm how to solve above error |
Hi All,
Need help plz..... |
The error is usually because the mysql server is not even running. is it? Why are you trying to "fix" this by installing an RPM that is for a different version of RHEL than the one you are using?? You have provided no useful information about your system whatsoever, so I don't really see how we are supposed to be able to help you. Given that you say you have no /var/lib/mysql directory, my money is on the fact that you've never even started it once, let alone configured it ready for use.
And do NOT bump your threads. You have NO right to get a response, and it's only been 90 minutes since the last reply. |
Hi acid kewpie,
First time i am installing this mysql , i am new to this. I am having two files .. 1)MySQL-client-5.5.11-1.rhel5.x86_64.rpm 2)MySQL-server-5.5.11-1.rhel5.x86_64.rpm and the commands i have run yet is Code:
my problm is i need to install this mysql today only. if need i can again reinstall this . Thanks in advance |
You do realise that once it's installed, which you're clearly struggling with, you still need to actually configure it as well??
What version of RHEL are you using? It looks like it's 6, as mysql-5.1.52-1.el6_0.1.x86_64 is apparently already installed, so stop trying to install software for version 5 for a start. IF you need to install software on RHEL, run "yum install mysql-server", do not download random packages from the net. If yum doesn't work due to having no RHN subscription, then you really have no business running RHEL in the first place and you should look to use a free alternative like CentOS. |
1) i dont know how to chek the version of RHEL?
2)when i have enter the command Mysql i am getting below output Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 4)Not getting what to do next? :-( |
Without wishing to sound rude, is there just not someone else there who can do this instead? If you're not even aware of the version of operating system you're using, it really feels that this is all going to be somewhat futile. You really can't "think" something is installed, you need to *KNOW*.
Does "yum install mysql-server" or "yum install mysql" work? - meaning, does it say that mysql is installed? You should see something like this... http://www.ehowstuff.com/how-to-inst...on-centos-6-2/ In general, this guide looks like it might be useful http://www.if-not-true-then-false.co...-red-hat-rhel/ |
Quote:
Quote:
Check whether your mysqld service is running or not? Quote:
Quote:
|
Quote:
i am using the version- Code:
Linux TEST2 2.6.32-131.0.15.el6.x86_64 #1 SMP Sat May 21 10:27:57 CDT 2011 x86_64 x86_64 x86_64 GNU/Linux can anyone help me from staring as in the last post i have mentined what i have done yet Quote:
|
Quote:
if on my server "mysql-5.1.52-1.el6_0.1.x86_64i" is already installed ...the how can i use the same when i run the command -" mysql" on server its giving me Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) |
All times are GMT -5. The time now is 08:57 AM. |