Is it possible to set each database in MySQL to use a separate datadir?
I'm running a userdir development (sandbox) server and would like to put the MySQL data files for the database(s) for that user in their /home/<user>/mysql
directory. How would you do this?
- Linux Ubuntu Server 10.4
- MySQL Server version: 5.1.41
- Storage Engine type: InnoDB
If you are not using INNODB or the innodb_file_per_table, then just stop the database server, move the database folder to whatever location you like, then create a symbolic link to the new location from the mysql folder. Mysql will still need access to the files, so you can't simply change the permissions so that particular user owns the directory/files though. Please do test first with test data.