id: 11523    nodeId: 11523    type: General    point: 123.0    linkPoint: 1.0    maker: cella    permission: linkable    made at: 2012.06.06 21:50    edited at: 2012.06.06 21:50
mysql data in different file system (partition)
http://serverfault.com/questions/249651/how-can-i-put-mysql-databases-in-different-disk-partitions-linux-ubuntu
Create the new partition and filesystem. Mount it somewhere. Stop mysql and copy the entire contents of /var/lib/mysql to the new location. Be sure to preserve permissions and ownership.

You now have a few options (all assuming you mounted the new filesystem in /opt/mysql_data:

1. Delete /var/lib/mysql and create a symlink from it to the new directory. For example:

ln -s /opt/mysql_data /var/lib/mysql

2. Create a file in /etc/mysql/conf.d called "local_configs.cnf" and put the following lines in that file:

[mysqld]
datadir=/opt/mysql_data

3. After the data is copied, mount the new filesystem directly on /var/lib/mysql.

Whichever path you take, when you start mysql back up again it will be using the new location.

Return to tonin: 오르골 박물관 or mysql data in different file system (partition)