MySQL Database Server won't start. Error: Timeout error occurred trying to start MySQL Daemon.

Hi, MySQL Database Server won’t start in Virtualmin for some reason.
Error: Fails to start error:
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED].

I have tried:
rebooting Virtualmin
cli $ mysqld stop; mysqld_safe &

/var/lib/mysql directory doesn’t exist.
/var/log/mysql directory doesn’t exist.
/etc/mysql has conf.d and my.cnf.
my.cnf has standard code as far as I can tell

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
 
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
 
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
 
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0
 
[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
#
# * Fine Tuning
#
key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries       = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                        = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
max_binlog_size         = 100M
#binlog_do_db           = include_database_name
#binlog_ignore_db       = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
 
 
 
[mysqldump]
quick
quote-names
max_allowed_packet      = 16M
 
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
 
[isamchk]
key_buffer              = 16M
 
#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

I tried logging into the MySQL Server Module at www.domain.com/phpmyadmin, but the Username root and password won’t let me log in.
I didn’t change the password and haven’t found a way to reset it yet.

Hmm, it’s very unusual that those directories don’t exist… is this a new server?

Also, what Linux distro and version are you using?

However, if the /var/lib/mysql directory doesn’t exist, that would be a big problem – that’s where the MySQL databases and such are stored, and would be needed for MySQL to function properly.

That would normally be configured by default upon installing MySQL. It sounds like that may have been deleted for some reason…

-Eric

Hi, it’s a rebuilt server, but the site was working before with this rebuilt server.

The website is running on:

System hostname localhost.localdomain (127.0.0.1) Operating system CentOS Linux 6.4 Webmin version 1.660 Virtualmin version 4.03.gpl GPL Theme version 8.7 Time on server 22/Nov/2013 12:30 , Up 4 hours, 27 minutes Kernel and CPU Linux 2.6.32-358.el6.x86_64 on x86_64 CPU load averages 0.20 (1 min) 0.12 (5 mins) 0.09 (15 mins)

So today, I can’t access the site from my computer.
dig www.domain.com gives working results:

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> www.domain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21989
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.domain.com.		IN	A

;; ANSWER SECTION:
www.domain.com.	38196	IN	A	WAN IP

;; Query time: 3 msec
;; SERVER: 192.168.1.180#53(192.168.1.180)
;; WHEN: Fri Nov 22 12:23:33 2013
;; MSG SIZE  rcvd: 53

isup.me says the site is working.
I can ping www.domain.com locally.
Another site on Virtualmin is working and I can load it locally.

Well, maybe it needs another reinstall after the folder.
I did a search for mysql and these are the results:

/usr/libexec/webmin/gray-theme/mysql
/usr/libexec/webmin/virtual-server-theme/mysql
/usr/libexec/webmin/mysql
/usr/libexec/webmin/mscstyle3/mysql
/usr/libexec/webmin/blue-theme/mysql
/usr/libexec/webmin/caldera/mysql
/usr/libexec/usermin/gray-theme/mysql
/usr/libexec/usermin/virtual-server-theme/mysql
/usr/libexec/usermin/mysql
/usr/libexec/usermin/blue-theme/mysql
/usr/libexec/usermin/caldera/mysql
/usr/include/mysql
/usr/share/mysql
/usr/bin/mysql
/usr/lib64/mysql
/usr/lib64/perl5/DBD/mysql
/usr/lib64/perl5/auto/DBD/mysql
/etc/webmin/mysql
/etc/webmin/status/history/mysql
/etc/usermin/mysql
/home/domain1/public_html/phpmyadmin/js/codemirror/mode/mysql
/home/domain2/public_html/phpmyadmin/js/codemirror/mode/mysql
/var/lib/mysql
/var/lib/mysql/mysql

This search result shows mysql now in /var/lib/mysql.
I went to /var/lib and mysql is now there.

So, I went to Virtualmin > System Information > MySQL Database Server > clicked the green start arrow/triangle > doesn’t start and no error.
Odd as yesterday gave the error:
SQL ERROR [mysql4]
Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) [2002]
An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

The error now is:
Failed to start service :
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED]

Hmm, the error you’re seeing now sounds like the same one you mentioned in your initial post yesterday.

If you log into the command line, what output do you receive if you try to start MySQL by running this command:

/etc/init.d/mysqld start

The output from
/etc/init.d/mysqld start is
Starting mysqld: [ OK ]

I have restored the whole Virtualmin server from a week earlier’s backup.
Now www.domain.com/phpmyadmin loads and I can access it with the username and password (couldn’t before the restore).
However, www.domain.com doesn’t load.
I can ping www.domain.com locally.
isup.me says site is up.

Also, usermin won’t login with username: root and password: password even after the restore?

Okay, fixed…kind of cheated by restoring all of Virtuamin and rebooting my computer let the site come up.
So, which logs should I access to see if anyone has accessed the server to change passwords as this happens a lot?