MySQL problem, please help

SebastianC

Active Member
Nov 25, 2003
27
0
151
Hello:

I have restore my OS (fedora) and Cpanel today. All is working fine, but MySQL can´t start. In VHM when I try to restart MySQL, I have this error:

----------------
DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /scripts/restartsrv_mysql line 74 mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").
----------------

At /var/lib/mysql/ I don't have the file mysql.sock, and neither inside my hard drive :confused:

Any idea how can I fix it?

Thanks in advance,

Sebastian
 
P

paolorulez

Guest
symlink problem

login root

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

restart mysql
 
P

paolorulez

Guest
Shutdown the MySQL server and add these lines to your /etc/my.cnf file (if you don't have them already):

[mysqld]
socket=/var/lib/mysql/mysql.sock

save ed exit

service mysql stop or killall mysqld

cd tmp

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

/etc/rc.d/init.d mysql restart


Restart the server and it should work.
 

SebastianC

Active Member
Nov 25, 2003
27
0
151
Sorry, that neither works... thanks any way...

My /etc/my.cnf:

---------------------
[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock
set-variable = max_connections=500
safe-show-database

[client]
port=3306
socket=/var/lib/mysql/mysql.sock
---------------------

The problem is (I think) that the file mysql.sock not exists inside the server

[email protected] [~]# locate mysql.sock
[email protected] [~]#
 

jkims

Registered
Jan 8, 2004
4
0
151
We had the same problem and tried all the fixes we could find on this forum but none of them seemed to work. Everytime we tried to start MYSQL the mysql.sock and all the symlinks for it would just disapear.

We ended up just reloading MYSQL and the problem went away. The guys at fastservermanagement.com actually helped us out and did this for us.
 

Angel78

Well-Known Member
May 9, 2002
413
1
318
this is still not resolved (have to restart mysql 2 times to get it to work = to create sock file in /tmp)

Latest Stable & RHE
 

stuartj

Member
Jul 17, 2003
18
0
151
UK
Ive had this issue. The issue was the server could not connect to the cpanel mirror for mysql files in my case so I used another mirror and downloaded from

http://mysql.mirror.ok.ee/Downloads/MySQL-4.0/?M=D

RPMs you will need these to run a basic hosting server.

MySQL-server-4.0.22-0.i386.rpm
MySQL-embedded-4.0.22-0.i386.rpm
MySQL-client-4.0.22-0.i386.rpm
MySQL-devel-4.0.22-0.i386.rpm
MySQL-bench-4.0.22-0.i386.rpm
MySQL-shared-4.0.22-0.i386.rpm
MySQL-shared-compat-4.0.22-0.i386.rpm

wget these files and install them most importantly set the mysql root password at the end. This fixed my issue on a Fedora core 1 box and CentOS 3.3 and RH9 system ive setup tonight.

Stuart
 

gordonrp

Member
Oct 14, 2004
8
0
151
I have the same problem.

I have tried all above and still get the error:

Warning, no valid mysql.sock file found.
mysql has failed

Any ideas?

tia
gp
 

TDD

Active Member
Dec 21, 2002
38
0
156
The issue was that /tmp was chmod to 755, so MySQL couldn't create it's temporary
files. I chmod it to 777 and MySQL could start without error.
 

ttiger

Member
Sep 1, 2004
11
0
151
Why is there no fix for this? I have tried every single thing in this thread and a thousand others with no success.
 

jezzzicuh

Registered
Sep 11, 2002
3
0
151
Me too

I am having the exact same problem, and have tried everything as well. This seems to be a serious Cpanel issue, and I am shocked they have not provided better service with this.