Sometimes on my VPS I get the error
Warning: mysql_pconnect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) in /var/www/mysql.php on line 8
It can be solved by restarting MySQL several times, restating the sever or sometimes using mysqld command.
Using the mysqld command I get the following:
root@web:~# mysqld 130109 10:47:23 [Note] Plugin 'FEDERATED' is disabled. 130109 10:47:23 InnoDB: The InnoDB memory heap is disabled 130109 10:47:23 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130109 10:47:23 InnoDB: Compressed tables use zlib 184.108.40.206 130109 10:47:23 InnoDB: Initializing buffer pool, size = 128.0M 130109 10:47:23 InnoDB: Completed initialization of buffer pool 130109 10:47:23 InnoDB: highest supported file format is Barracuda. InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 130109 10:47:23 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... 130109 10:47:24 InnoDB: Waiting for the background threads to start 130109 10:47:25 InnoDB: 1.1.8 started; log sequence number 43428438 130109 10:47:25 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 130109 10:47:25 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 130109 10:47:25 [Note] Server socket created on IP: '0.0.0.0'. 130109 10:47:25 [Note] Event Scheduler: Loaded 0 events 130109 10:47:25 [Note] mysqld: ready for connections. Version: '5.5.28-0ubuntu0.12.04.3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) 130109 10:47:25 [ERROR] mysqld: Table './sever/table' is marked as crashed and should be repaired 130109 10:47:25 [ERROR] mysqld: Table './sever/table' is marked as crashed and should be repaired 130109 10:47:25 [ERROR] mysqld: Table './sever/table' is marked as crashed and should be repaired 130109 10:47:25 [Warning] Checking table: './sever/table'
My get only 50 visitors a day and uses more than 3000 queries per hour. My VPS is only 1 core with 256MB ram and runs on Ubuntu 64bit.
MySQL downtimes directly affect my website and I can't find a answer anywhere.
Thanks in Advance :)