MySQL does not start if data directory is changed from the default /var/lib/mysql

Solution Verified - Updated -

Issue

  • MySQL doesn't start after modifying the data directory to a different location from its default (/var/lib/mysql).
  • Modifying MySQL data directory location produces selinux errors and mysqld doesn't start.
  • How to configure mysql to point to custom datadir with Selinux enabled ?

Environment

  • Red Hat Enterprise Linux Server release 5 (all version)
  • Selinux enabled .

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content