My VPS had a hardware failure, and I was knocked out of service for the past 24 hours. Now that it's back up, MySQL refuses to work. Please keep in mind that my VPS with these exact configurations has been running for the past 2 months without error, I have not changed any code/database settings since the hardware failure.
At the command line, simply typing "sudo mysql" returns
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I can not login with PhpMyAdmin, I receive 2 errors:
#2002 Cannot log in to the MySQL server
Connection for controluser as defined in your configuration failed.
My web app (Codeigniter) returns the following error
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
I am running a typical LAMP stack on Ubuntu 10.04. I have more than enough free space on my hard disk still (over 20 gigs left), so being out of space is not an issue.
/var/log/mysql.err has nothing in it, it is an empty file. I have searched high and low on Google, but seem to be at a complete loss right now.
EDIT:
Running mysqld
gave me
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
120630 18:41:10 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
120630 18:41:10 InnoDB: Initializing buffer pool, size = 8.0M
120630 18:41:10 InnoDB: Completed initialization of buffer pool
120630 18:41:10 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
at first, now running mysqld
, I get nothing, just returns me to the prompt.
EDIT 2:
Running strace -e trace=file mysqld
returns:
120630 19:17:12 [Note] Plugin 'FEDERATED' is disabled.
open("./mysql/plugin.frm", O_RDONLY) = -1 EACCES (Permission denied)
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
120630 19:17:12 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
open("/tmp/ibzhYSAn", O_RDWR|O_CREAT|O_EXCL, 0600) = 1
unlink("/tmp/ibzhYSAn") = 0
open("/tmp/ibRf9302", O_RDWR|O_CREAT|O_EXCL, 0600) = 1
unlink("/tmp/ibRf9302") = 0
open("/tmp/ibN6AjrI", O_RDWR|O_CREAT|O_EXCL, 0600) = 1
unlink("/tmp/ibN6AjrI") = 0
120630 19:17:12 InnoDB: Initializing buffer pool, size = 8.0M
120630 19:17:12 InnoDB: Completed initialization of buffer pool
open("/tmp/ibGh8aSn", O_RDWR|O_CREAT|O_EXCL, 0600) = 1
unlink("/tmp/ibGh8aSn") = 0
open("./ibdata1", O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
open("./ibdata1", O_RDWR) = -1 EACCES (Permission denied)
120630 19:17:12 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.