Server shutdown from power failure.
Mysql will not start now.
Disk is not full. Syslog is below
Oct 11 15:03:31 joe mysqld_safe[24757]: started Oct 11 15:03:31 joe mysqld[24760]: 101011 15:03:31 InnoDB: Operating system error number 13 in a file operation. Oct 11 15:03:31 joe mysqld[24760]: InnoDB: The error means mysqld does not have the access rights to Oct 11 15:03:31 joe mysqld[24760]: InnoDB: the directory. Oct 11 15:03:31 joe mysqld[24760]: InnoDB: File name ./ibdata1 Oct 11 15:03:31 joe mysqld[24760]: InnoDB: File operation call: 'create'. Oct 11 15:03:31 joe mysqld[24760]: InnoDB: Cannot continue operation.
The file ibdata1 is the system tablespace for the InnoDB infrastructure. It contains several classes for information vital for InnoDB. Table Data Pages. Table Index Pages. Data Dictionary.
The ibdata1 file cannot shrink, it is a particularly troublesome feature of MySQL. The ibdata1 file can be shrinked if you delete all databases, remove the files and reload the mysqldump. We can configure MySQL so that each table, including its indexes, is stored as a separate file.
Errors in configuration – MySQL stores its configuration settings in ‘/etc/my.cnf’ file. Any errors or unsupported parameters in this config file can prevent the server from starting. Corrupt MySQL binary – When MySQL binary or tables gets corrupt, it can cause the MySQL server to fail or not start.
MySQL port already in use – If some other process is running in the MySQL port (default 3306), MySQL would be unable to bind to the port and cannot run. Unable to write to /tmp – If the /tmp directory is not writable due to permission issues or lack of space, MYSQL cannot write the needed files and cannot start.
InnoDB has corruption detection (page checksums) and would happily tell you if that were the problem. Either the directory permissions have changed, or your my.cnf file has been hosed, and it's trying to recreate data files somewhere else.
Out of memory – If MySQL process is not getting enough memory due to abusive processes or any other valid process, it cannot start or would keep crashing all the time. [ You don’t have to lose your sleep to keep your customers happy. Our friendly Support Engineers are online 24/7/365 to help your customers.
If you are using ubuntu or apparmor you should permit this change in apparmor.
Edit /etc/apparmor.d/usr.sbin.mysqld
and change /var/lib/mysql
with the new DATADIR
.
It should work.
Error:
101130 14:42:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 101130 18:07:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 101130 18:07:58 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.
Solution SeLinux SeLinux security:
[root@localhost ~]# service mysqld restart Deteniendo mysqld: [ OK ] Iniciando mysqld: [ FALLÓ ] [root@localhost ~]# restorecon -R /var/lib/mysql/ [root@localhost ~]# service mysqld restart Deteniendo mysqld: [ OK ] Iniciando mysqld: [ OK ] [root@localhost ~]#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With