Changes between Version 4 and Version 5 of MoveDatabaseToOtherPartition
- Timestamp:
- 2011-04-13T09:26:57+02:00 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MoveDatabaseToOtherPartition
v4 v5 4 4 5 5 2) Stop the MySQL database 6 "/etc/init.d/mysql stop" 6 7 {{{ 8 /etc/init.d/mysql stop 9 }}} 10 7 11 8 12 3) Move the folder to the new directory to the new partition (/your/new/location/) 9 13 10 14 4) Give MySQL ownership of the directory 11 "chown -R mysql:mysql /your/new/location/*" 15 16 {{{ 17 chown -R mysql:mysql /your/new/location/* 18 }}} 19 12 20 13 21 5) Create a Symlink between the old directory and the new created dir. 14 "ln -s /your/new/location/MySQLdatabase /var/lib/mysql/MySQLdatabase" 22 23 {{{ 24 ln -s /your/new/location/MySQLdatabase /var/lib/mysql/MySQLdatabase 25 }}} 26 15 27 16 28 6) Edit the AppArmor file (Most often located at: /etc/apparmor.d/usr.sbin.mysqld) 17 29 Add the location of your database to the file. 18 " /your/new/location/ r," 19 " /your/new/location/** rwk," 30 31 {{{ 32 /your/new/location/ r,[[BR]] 33 /your/new/location/** rwk, 34 }}} 35 20 36 21 37 7) Restart AppArmor 22 "service apparmor restart" 38 39 {{{ 40 service apparmor restart 41 }}} 42 23 43 24 44 8) Restart the MySQL database 25 "/etc/init.d/mysql start" 45 46 {{{ 47 /etc/init.d/mysql start 48 }}} 49 26 50 27 51