Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

MySql problems

Status
Not open for further replies.
Joined
Jan 1, 2005
Posts
160
Reaction score
12
Following a Red Hat Linux server restart (which may well have enacted some updates) I am unable to start/restart mysql:

/etc/init.d/mysql restart
MySQL PID file could not be found! [FAILED]
Starting MySQL................................... [FAILED]

Simply typing "mysql" gives me
mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

I've looked through various forums etc. and can't find an answer, I've edited /etc/my.cnf
to point to both mysql.sock files I can find on the machine, neither helps.

Any ideas?
 
What does the mysql error file say? It'll be somewhere like /var/lib/mysql/{hostname}.err

Where {hostname} is the hostname of the machine.
 
looks like the mysql process that the pid - process ID file holds has died. In the past I've emptied - not removed that file. On rare ocassions I've had to create it as well.

Start and stop mysql to see if it's ok. It may have left tables in a crashed (unclosed correctly) state which need repairing - either through mysqlcheck or myisamchk (with mysql off).

If you use phpMyAdmin then that will have repair options.

I prefer myisamchk (if the db used myisam - default) but you need root/mysql permissions to run that.

S
 
Thank you for the suggestions - the below is the results from trying them:
What does the mysql error file say?.
Number of processes running now: 0
060902 12:20:31 mysqld restarted
060902 12:20:32 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
060902 12:20:32 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 1237811.
InnoDB: Doing recovery: scanned up to log sequence number 0 1237811
060902 12:20:32 InnoDB: Flushing modified pages from the buffer pool...
060902 12:20:32 InnoDB: Started; log sequence number 0 1237811
/usr/sbin/mysqld: ready for connections.
Version: '4.1.21-standard' socket: '/var/lib/mysql/mysql.sock' port: 3306 My$

A restart mysql attempt results in
/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "mysql has failed").

It could be a firewall problem?

I've run the following commands
service iptables stop
iptables --flush
 
Is this a cPanel machine? Do you have a "basedir=" entry in your /etc/my.cnf?
 
Is this a cPanel machine? Do you have a "basedir=" entry in your /etc/my.cnf?
Yes, this is WHM/cPanel on Red Hat Linux

I do not have a basedir entry in /etc/my.cnf
There is no basedir either in /usr/local/cpanel/whostmgr/my.cnf
 
Ok.. Do you have a symlink in /tmp/ still for mysql.sock?

In /tmp/

I have
mysql.sock@


In response to "locate mysql.sock" (recently having run updatedb) I have:
/var/lib/mysql/mysql.sock
/usr/local/lib/mysql.sock
 
The result of running the command "ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock"
Was ln: `/tmp/mysql.sock': File exists

A restart attempt of mysql resulted in the same error as before.

This error was the same following the running of the command: "ln -s -f /var/lib/mysql/mysql.sock /tmp/mysql.sock
 
I tried running mysqlup (updating mysql without success)

su mysql
bash-3.00$ /usr/sbin/mysqld
080627 15:35:22 [ERROR] Can't start server : Bind on unix socket: Permission denied
080627 15:35:22 [ERROR] Do you already have another mysqld server running on socket: /usr/local/lib/mysql.sock ?

No other mysqld :
killall -9 mysqld
mysqld: no process killed

I don't know about the "permission denied".
 
I have tried a number of restarts

I have ensured there are no basedir entries in mysql.cnf

I have also performed a forced upgrade of MySQL and restarted.
 
I don't think you should be able to start mysql as root very easily - I think you should perhaps be the mysql user or another.

forget that I cant find any evidence online to support my theory!

yesterday
 
Last edited:
Alternatively, try looking on the cpanel forums, as you won't have been theonly person with that problem :)
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

Latest Comments

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom