Results 1 to 3 of 3

Thread: Mysql - Service will not start ater moving DBs

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Beans
    25

    Mysql - Service will not start ater moving DBs

    Hi all,

    I have been reading about this for a good day now, and no matter what I try, the mysql service will not restart after moving the database location. Could you please take a look at what I'm doing below and let me know where I'm going wrong?

    (My comments are prefixed with **)


    me@machine:~$ service mysql stop
    mysql stop/waiting
    me@machine:~$ sudo cp -R -p /var/lib/mysql /media/Data/mysql_data
    me@machine:~$ sudo rm /media/Data/mysql_data
    rm: cannot remove `/media/Data/mysql_data': Is a directory
    me@machine:~$ sudo gksu gedit /etc/mysql/my.cnf
    ** Edit the file accordingly with "datadir = /media/Data/mysql_data*
    me@machine:~$ sudo gedit /etc/apparmor.d/usr.sbin.mysqld
    ** Edit the file accordingly with "/media/Data/mysql_data/ r,
    /media/Data/mysql_data/** rwk,*
    ** commented out lines referring to old data location

    me@machine:~$ sudo /etc/init.d/apparmor reload
    * Reloading AppArmor profiles Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
    Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
    [ OK ]
    me@machine:~$ sudo /etc/init.d/mysql restart
    start: Job failed to start


    No matter what I do, the service will not restart. Could someone (anyone!) let me know how to get around this?

    Thanks!
    - WoolyG

  2. #2
    Join Date
    Dec 2006
    Beans
    25

    Re: Mysql - Service will not start ater moving DBs

    ..wow. Literally 5 minutes after posting, I changed the permissions on the parent folder of the new data directory, and boom, the service starts.

    I hope this helps someone else out in the future. Thanks for reading.

    - Woolyg

  3. #3
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Mysql - Service will not start ater moving DBs

    Quote Originally Posted by woolyg View Post
    ..wow. Literally 5 minutes after posting, I changed the permissions on the parent folder of the new data directory, and boom, the service starts.
    Then MARK the thread!
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •