Abilnet
Verified User
My server has been working without any problems for years, until now. What happened:
* after updating some modules to my Drupal CMS, I'd run "update.php" (Drupal) to update database tables (this is a very routine & standard procedure in Drupal)
* ended up to error -messages from CMS
* realized, that the database of the site in question was somehow corrupted
* backups did not work, errors continued
* at this point, other sites on the server were still working ok (obviously MySQL was up & running)
* restarted MySQL (trying to solve the problematic database issue)
* MySQL did not start anymore (and is still dead)
Done since:
* read a lot of forums & Google
* verified hard disks; a lot of space available
* even rebooted the entire box (sorry about that)
* trying to restart MySQL will output:
* from my CMS I'm getting errors:
* error from phpMyAdmin:
* my /etc/mysql/my.cnf:
* /home/mysql/s1.server.com.err:
* datadir = /var/lib/mysql:
---> directory does not exist (data seems (?) to be in: /home/mysql)
* socket = /var/run/mysqld/mysqld.sock:
---> does not exist, not even the directory "mysql"
* MySQL does not start also from Direct Admin, only an error message: "An error has occurred" (with no additional details)
* my server setup:
I've tried everything possible I can think of, your ideas & help Very Much appreciated. Thank you.
* after updating some modules to my Drupal CMS, I'd run "update.php" (Drupal) to update database tables (this is a very routine & standard procedure in Drupal)
* ended up to error -messages from CMS
* realized, that the database of the site in question was somehow corrupted
* backups did not work, errors continued
* at this point, other sites on the server were still working ok (obviously MySQL was up & running)
* restarted MySQL (trying to solve the problematic database issue)
* MySQL did not start anymore (and is still dead)
Done since:
* read a lot of forums & Google
* verified hard disks; a lot of space available
* even rebooted the entire box (sorry about that)
* trying to restart MySQL will output:
Code:
root@server1:~# /etc/init.d/mysqld restart
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
root@server1:~#
* from my CMS I'm getting errors:
Code:
PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in lock_may_be_available() (line 167 of /home/xxxxxx/domains/xxxxx.com/public_html/includes/lock.inc).
AND
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
* error from phpMyAdmin:
Code:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
* my /etc/mysql/my.cnf:
Code:
[client]
port = 3306
# socket = /var/run/mysqld/mysqld.sock
socket = /tmp/mysql.sock
[mysqld_safe]
# socket = /var/run/mysqld/mysqld.sock
socket = /tmp/mysql.sock
nice = 0
[mysqld]
user = mysql
# socket = /var/run/mysqld/mysqld.sock
socket = /tmp/mysql.sock
port = 3306
basedir = /usr
# datadir = /var/lib/mysql
datadir = /home/mysql
tmpdir = /tmp
skip-external-locking
bind-address = 127.0.0.1
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
skip-innodb
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/
* /home/mysql/s1.server.com.err:
Code:
101204 06:37:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
101204 6:37:36 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
101204 6:37:37 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
101204 6:37:37 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
101204 6:37:37 InnoDB: Started; log sequence number 0 0
101204 6:37:37 [Note] Event Scheduler: Loaded 0 events
101204 6:37:37 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.34' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
101206 13:57:54 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown
101206 13:57:54 [Note] Event Scheduler: Purging the queue. 0 events
101206 13:57:54 InnoDB: Starting shutdown...
101206 13:57:56 InnoDB: Shutdown completed; log sequence number 0 84114
101206 13:57:56 [Warning] Forcing shutdown of 1 plugins
101206 13:57:56 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
101206 13:57:56 mysqld_safe mysqld from pid file /usr/local/mysql/data/s1.pid ended
101206 13:58:52 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
101206 13:58:53 InnoDB: Started; log sequence number 0 84114
101206 13:58:53 [Note] Event Scheduler: Loaded 0 events
101206 13:58:53 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.34' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
101208 13:24:30 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown
101208 13:24:30 [Note] Event Scheduler: Purging the queue. 0 events
101208 13:24:30 InnoDB: Starting shutdown...
101208 13:24:31 InnoDB: Shutdown completed; log sequence number 0 84114
101208 13:24:31 [Warning] Forcing shutdown of 1 plugins
101208 13:24:31 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
101210 10:21:52 mysqld_safe mysqld from pid file /usr/local/mysql/data/s1.pid ended
* datadir = /var/lib/mysql:
---> directory does not exist (data seems (?) to be in: /home/mysql)
* socket = /var/run/mysqld/mysqld.sock:
---> does not exist, not even the directory "mysql"
* MySQL does not start also from Direct Admin, only an error message: "An error has occurred" (with no additional details)
* my server setup:
Code:
Ubuntu 10.04 LTS
DirectAdmin 1.40.1
MySQL 5.1.34
Php 5.2.14
Apache 2.2.17
I've tried everything possible I can think of, your ideas & help Very Much appreciated. Thank you.