Hello when I try to start up my mysqld I get this error:
[root@localhost /]# service mysqld restart
Stopping mysqld: [ OK ]
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
the main reason is that my.cnf file can't find my mysql.sock file.
[root@localhost /]# mysqladmin -u root -p status
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!
When I try to search it with :
sudo find / -type s | grep mysqld.sock
I'll get
find: ‘/proc/3253/task/3253/fd/5’: Bestand of map bestaat niet
find: ‘/proc/3253/task/3253/fdinfo/5’: Bestand of map bestaat niet
find: ‘/proc/3253/fd/5’: Bestand of map bestaat niet
find: ‘/proc/3253/fdinfo/5’: Bestand of map bestaat niet
"Bestand of map bestaat niet" == "File or directory don't exists"
I'm new at this so can anyone help me please?
Nope. "THE MAIN REASON" is
mysqld has not started
, so there is no mysql.sock and any client cannot establish connection.Currently "why mysqld failds" is broad question. MySQL Error log has the reason 'Why MySQL fails'. If you know where mysql error log is, just open it, and post error message into you question.
But probably I guess you don't know where mysql error log is....
Identify where mysql error log is
So, we need to identify where it is. we could guess somewhere... but the exact approach is using
strace
now strace.log has all system call related to MySQL Deamon. open strace.log with any editor and search 'err"'. in my case
when open() fails
It could happen
open()
fails, common error isso you can find why mysqld fails to start in '/XXX/hostname.err'. we highly appreciate if you post error message.
p.s.
I have test strace with
Not sure working with
service mysqld
, but no reason not to workUPDATE
Actually
service mysqld start
invokes/etc/rc.d/init.d/mysqld start
(assuming CentOS or Fedora). so, you could try.If
my.cnf
which you referenced is right file for mysqld, open it and search[mysqld]
section. It looks like as followsMySQL error log is in
/path/data