How to create separate directory for Databases


I have just installed Percona XDB Cluster. Currently the datadir is set to /var/lib/mysql.

I want to have separate directory for Databsase only. Actually on SSD drives.

How can I do this.


MySQL doesn’t have an option to configure separate storage paths for each database. The usual way is to create database, shutdown mysql, move database to different drive, allow in apparmor/selinux, start mysql service and probably it requires to fix paths in mysqld init script.