Solving MySQL Installation of system tables failed

First of all, this is the case I encountered and may not be useful on your case.

Situation

To reset the data in MySQL database, for the sake of fixing out-sync database replication.

Procedure

  1. Stopped MySQL service
  2. Renamed the original data folder for backup purpose
  3. Create a new data folder with the same original name
  4. Execute database installation mysql_install_db
  5. Import the dumped data
  6. Set up replication

Problem

When executing database installation, the error message below appeared.

Installation of system tables failed!

Other Symptom

The following command print nothing to the console.

mysqld -V

Cause

After checking the log at /var/log/message, it is found that the SELinux prevented the installation.

Solution

Fix the security context issue used by SELinux

Sorry I am not going to provide the way here because I having really tried that myself.

Permanent set SELinux to Permissive or Disable (Security Risk)

Obviously this is not a good way to fix the problem but if you still want to do that, here is the way.

Edit the file:

vim /etc/selinux/config

Set to permissive

SELINUX=permissive

Or disable

SELINUX=disabled

Finally

This is what you can see:

[root@my-server ~]# mysqld -V
mysqld  Ver 4.1.22-standard-log for pc-linux-gnu on i686 (MySQL Community Edition - Standard (GPL))
[root@my-server ~]#

Extra: Temperately disable SELinux

Here is the way:

echo 0 > /selinux/enforce

Reference

HOWTO: Turning off or disabling SELinux

Advertisements