Changes between Initial Version and Version 1 of MoveDatabaseToOtherPartition


Ignore:
Timestamp:
2011-04-13T09:21:07+02:00 (14 years ago)
Author:
Marc Jan Bonder
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MoveDatabaseToOtherPartition

    v1 v1  
     1
     2== How to move a MySQL database to another partition ==
     3
     41) Create the database in MySQL
     5
     62) Stop the MySQL database
     7   "/etc/init.d/mysql stop"
     8
     93) Move the folder to the new directory to the new partition (/your/new/location/.
     10
     114) Give MySQL ownership of the directory
     12   "chown -R mysql:mysql /your/new/location/MySQLdatabase"
     13
     145) Create a Symlink between the old directory and the new created dir.
     15   "ln -s /your/new/location/MySQLdatabase /var/lib/mysql/MySQLdatabase"
     16
     176) Edit the AppArmor file (Most often located at: /etc/apparmor.d/usr.sbin.mysqld)
     18   Add the location of your database to the file.
     19   "  /your/new/location/ rw,"
     20   "   /your/new/location/* rw,"
     21
     227) Restart AppArmor 
     23   "service apparmor restart"
     24
     258) Restart the MySQL database
     26   "/etc/init.d/mysql start"
     27
     28
     29More information on:
     30http://mysqlhacker.com/kabir/tablespace/distributing-your-mysql-database-across-disk-partitions.html
     31http://www.ubuntu-howto.info/howto/how-to-move-mysql-databases-to-another-location-partition-or-hard-drive
     32http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/