{"id":1410,"date":"2016-03-21T17:50:13","date_gmt":"2016-03-22T00:50:13","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=1410"},"modified":"2016-03-21T17:50:13","modified_gmt":"2016-03-22T00:50:13","slug":"moving-mysql-to-a-different-partition-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1410","title":{"rendered":"Moving mysql to a different partition &#8211; Ubuntu 12.04"},"content":{"rendered":"<p>I needed to move my MySQL databases to a different partition, since I was outgrowing the space.  I created new space and used a mv command to move the files and preserve the permissions.  I moved them to \/mysql.  <\/p>\n<p>I set the permissions for the new directory:<br \/>\nchown mysql.mysql \/mysql<br \/>\nchmod 700 \/mysql<br \/>\nThen, I needed to modify the \/etc\/apparmor.d\/tunables\/alias file.  Note: It is actually documented in the alias file for MySQL.<\/p>\n<p># vi \/etc\/apparmor.d\/tunables\/alias<br \/>\n&#8230;<br \/>\nalias \/var\/lib\/mysql\/ -> \/mysql\/,<\/p>\n<p># service apparmor restart<br \/>\n# service mysql start<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed to move my MySQL databases to a different partition, since I was outgrowing the space. I created new space and used a mv command to move the files and preserve the permissions. I moved them to \/mysql. I set the permissions for the new directory: chown mysql.mysql \/mysql chmod 700 \/mysql Then, I [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[428,248,132],"class_list":["post-1410","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-move","tag-mysql","tag-ubuntu"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1410"}],"version-history":[{"count":2,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1410\/revisions"}],"predecessor-version":[{"id":1412,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1410\/revisions\/1412"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}