Change MySQL Database Location
Created: 12/10/2005
General Information
The default location for your MySQL database data files may need to be moved to another partition that offers more storage space, or you may want to keep your data organized. These simple steps allows you to move your MySQL data without losing any information.Requirements
Configuration
Changing where the databases are stored is quite simple. Just stop the running MySQL processes:| # | /usr/local/etc/rc.d/mysql-server.sh stop |
/etc/rc.conf:| # | echo 'mysql_dbdir="/path/to/dir"' >> /etc/rc.conf |
Note: Change /path/to/dir to wherever you want the new databases to be stored.
| # | cp -R /var/db/mysql/* /path/to/dir |
| # | /usr/local/etc/rc.d/mysql-server.sh start |
/path/to/dir.Author: Jon LaBass
jon at bsdguides dot org