My SQL fails to start using all possible means

March 6, 2016 1.7k views
MySQL Apache WordPress DigitalOcean PHP Ubuntu

Hey There!,
I'm on Ubuntu 14.04
I'm trying to start my SQL service using :

  1. sudo service mysql start
    Fails with error "
    start: Job failed to start"

  2. sudo /etc/init.d/mysql start (fails again)

I thought it was a permission issue, so I logged in from Root and ran the same commands... But it again failed.

I tried running:
sudo -u mysql mysqld
This is what I got:

160306 1:39:19 [Warning] Using unique option prefix keybuffer instead of keybuffer_size is deprecated and will be removed in a future release. Please use the full name instead.
160306 1:39:19 [Note] mysqld (mysqld 5.5.46-0ubuntu0.14.04.2) starting as process 3340 ...
160306 1:39:19 [Warning] Can't create test file /var/lib/mysql/3011-NXTNEWS-2015.lower-test
160306 1:39:19 [Warning] Can't create test file /var/lib/mysql/3011-NXTNEWS-2015.lower-test
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
160306 1:39:19 [ERROR] Aborting

Does anyone know what the issue is, mySQL error logs say this:

160306 00:33:53 mysqldsafe Starting mysqld daemon with databases from /var/lib/mysql
160306 0:33:53 [Warning] Using unique option prefix key
buffer instead of keybuffersize is deprecated and will be removed in a future release. Please use the full name instead.
160306 0:33:53 [Note] /usr/sbin/mysqld (mysqld 5.5.46-0ubuntu0.14.04.2) starting as process 2840 ...
160306 0:33:53 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
160306 0:33:53 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160306 0:33:53 [ERROR] Can't open the mysql.plugin table. Please run mysqlupgrade to create it.
160306 0:33:53 InnoDB: The InnoDB memory heap is disabled
160306 0:33:53 InnoDB: Mutexes and rw
locks use GCC atomic builtins
160306 0:33:53 InnoDB: Compressed tables use zlib 1.2.8
160306 0:33:53 InnoDB: Using Linux native AIO
160306 0:33:53 InnoDB: Initializing buffer pool, size = 128.0M
160306 0:33:53 InnoDB: Completed initialization of buffer pool
160306 0:33:53 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: 'create'.
InnoDB: Cannot continue operation.
160306 00:33:53 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

I've tried everything that has worked for other users in forums but mySQL doesn't seem to want to start.

I also tried mysql_upgrade and I get:
FATAL ERROR: Upgrade failed

P.S. I'm using Cloudfare, I've blocked XML-RPC pingbacks. I tried contacting the support here, they say "As an unmanaged hosting provider, we do not have access to our customers' servers or have the resources to provide System Administration services. At this point you will need to look through your MySQL error logs to determine exactly where the failure is occurring. "

So I'm at a loss on what to do next...

Any advice would be appreciated

1 Answer

Does /var/lib/mysql/ exist and is it owned by mysql:mysql?

Have another answer? Share your knowledge.