# MySql server is not starting after xtrabackup restore using innobackupex tool

**URL:** <https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929>\
**Category:** Percona XtraBackup\
**Created:** [September 10, 2013, 7:16am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929 "2013-09-10T07:16:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harsh\_Pandit](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Harsh\_Pandit](https://forums.percona.com/u/Harsh_Pandit)\
**Post date:** [September 10, 2013, 7:16am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/1 "2013-09-10T07:16:47Z")

</div>

Hi

I am a beginner on xtrabackup however, i have successfully backup my whole database and restore the same using innobackupex script. Problem comes when after restore i tried to restart MySQL server. It gave me error like "The server quit without updating PID file (/var/lib/mysql).

Let me tell here that before to restore from xtrabackup, i move /var/lib/mysql to /var/lib/mysql-old and made /var/lib/mysql blank. Also in order to avoid permission issues, I gave mysql user permission to access the above mention folder as “sudo chown -R mysql:mysql /var/lib/mysql/”

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [September 10, 2013, 7:51am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/2 "2013-09-10T07:51:59Z")

</div>

What does the MySQL error log say? It’s always the first place you should be looking at.

---

<div class="post-metadata">

**Author:** ![eroomydna](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/eroomydna/32/941_2.png) [@eroomydna](https://forums.percona.com/u/eroomydna)\
**Post date:** [September 10, 2013, 4:25pm UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/3 "2013-09-10T16:25:09Z")

</div>

More details about your backup and restore efforts are needed here for anyone to be able to provide help. As Przemek mentioned the error log will usually hold the key to your issues in cases like this.

When creating the backup did you stream to a tar file? Remember you to use the -i argument when unpacking the files from a tar archive built using innobackupex

-i, --ignore-zeros ignore zeroed blocks in archive (means EOF)

---

<div class="post-metadata">

**Author:** ![Harsh\_Pandit](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Harsh\_Pandit](https://forums.percona.com/u/Harsh_Pandit)\
**Post date:** [September 12, 2013, 9:13am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/4 "2013-09-12T09:13:59Z")

</div>

Hi przemek

I tried a lot to find the err file however after replacing old datadirectory /var/lib/mysql with the new files generated by xtrabackup --copy-back. Mysql is not generating any error file. In actual datadirectory, i found a file named as [dhcppc1.err], which has server startup errors however they are not related to the new setup.

Please suggest.

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [September 12, 2013, 11:35am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/5 "2013-09-12T11:35:29Z")

</div>

Hard to say without seeing an error, but the three usual suspects are:

1. The server you are restoring to is using a different innodb\_log\_file\_size
2. SELinux or AppArmor is complaining about the new files and you need to modify the file contexts
3. Permissions are wrong (but you seem to have covered that already)

---

<div class="post-metadata">

**Author:** ![Harsh\_Pandit](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Harsh\_Pandit](https://forums.percona.com/u/Harsh_Pandit)\
**Post date:** [September 17, 2013, 7:46am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/6 "2013-09-17T07:46:41Z")

</div>

Hi

I tried it again and now with proper error log file. Here are the details of error log:  
130917 09:09:59 mysqld\_safe Starting mysqld daemon with databases from /var/lib/mysql  
2013-09-17 09:09:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit\_defaults\_for\_timestamp server option (see documentation for more details).  
2013-09-17 09:09:59 2399 [Note] Plugin ‘FEDERATED’ is disabled.  
^G/usr/sbin/mysqld: Can’t find file: ‘./mysql/plugin.frm’ (errno: 13 - Permission denied)  
2013-09-17 09:09:59 2399 [ERROR] Can’t open the mysql.plugin table. Please run mysql\_upgrade to create it.  
2013-09-17 09:09:59 2399 [Note] InnoDB: The InnoDB memory heap is disabled  
2013-09-17 09:09:59 2399 [Note] InnoDB: Mutexes and rw\_locks use GCC atomic builtins  
2013-09-17 09:09:59 2399 [Note] InnoDB: Compressed tables use zlib 1.2.3  
2013-09-17 09:09:59 2399 [Note] InnoDB: Using Linux native AIO  
2013-09-17 09:09:59 2399 [Note] InnoDB: Not using CPU crc32 instructions  
2013-09-17 09:09:59 2399 [Note] InnoDB: Initializing buffer pool, size = 256.0M  
2013-09-17 09:09:59 2399 [Note] InnoDB: Completed initialization of buffer pool  
2013-09-17 09:09:59 b77598e0 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.  
2013-09-17 09:09:59 b77598e0 InnoDB: File name /var/lib/mysql/ibdata1  
2013-09-17 09:09:59 b77598e0 InnoDB: File operation call: ‘stat’ returned OS error 113.  
2013-09-17 09:09:59 2399 [ERROR] InnoDB: os\_file\_get\_status() failed on ‘/var/lib/mysql/ibdata1’. Can’t determine file permissions  
2013-09-17 09:09:59 2399 [ERROR] InnoDB: The system tablespace must be writable!  
2013-09-17 09:09:59 2399 [ERROR] Plugin ‘InnoDB’ init function returned error.  
2013-09-17 09:09:59 2399 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.  
2013-09-17 09:09:59 2399 [ERROR] Unknown/unsupported storage engine: InnoDB  
2013-09-17 09:09:59 2399 [ERROR] Aborting

As, we can see, there are two issues:

1. plugin.frm is not accessible however, i had given permission to mysql user for this folder using (chown -R mysql:mysql /var/lib/mysql), which is the base directory.
2. mysqld doesn’t have access right to Innodb, Here also i had provided read and write permissions to user and groups using (chmod 661 /var/lib/mysql/ibdata1) and to log files also.

Note: I am using my linux box using root user. Also, i tried using restarting my system.

Please suggest.

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [September 17, 2013, 2:53pm UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/7 "2013-09-17T14:53:59Z")

</div>

Make sure the MySQL user has execute privs for all necessary directories still.

Aside from that, do you have SELinux or AppArmor installed/enabled? That would cause similar access errors.

---

<div class="post-metadata">

**Author:** ![Harsh\_Pandit](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Harsh\_Pandit](https://forums.percona.com/u/Harsh_Pandit)\
**Post date:** [September 18, 2013, 1:04am UTC](https://forums.percona.com/t/mysql-server-is-not-starting-after-xtrabackup-restore-using-innobackupex-tool/2929/8 "2013-09-18T01:04:02Z")

</div>

Hi Scott/Przemek

Thank you so much guys !

I finally got the issue and server started after resolving it. There was a SELinux security issues, which was not allowing mysql to consider new datadirectory.

Best Regards  
Harsh 🙂
