List:General Discussion« Previous MessageNext Message »
From:Johnny Withers Date:August 26 2009 1:40am
Subject:Re: Fail to change MySQL data directory on ubuntu
View as plain text  
First, check the error log, if you can't find it, start mysql from the
cmd line by running safe_mysqld it should print errors to console.

If it is a permission issue, it might be caused be selinux, you'll
need to change the object type od that new directory to mysqld-
something. I can't recall the command. A google search on selinux and
mysql should produce good results.

On Tuesday, August 25, 2009, chen jia <chen.1002@stripped> wrote:
> Hi there,
>
> I am using MySQL on ubuntu 8.04.
>
> I followed this link
>
> http://www.ubuntu-howto.info/howto/how-to-move-mysql-databases-to-another-location-partition-or-hard-drive
> to change the data directory of MySQL.
>
> After stopping MySQL: sudo /etc/init.d/mysql stop
>
> I make a new directory: sudo mkdir /media/disk/MySQL_data
>
> then change the ownership of new directory, sudo chown mysql:mysql
> /media/disk/MySQL_data
>
> and copy all data to the new directory, cp -r -p /var/lib/mysql/*
> /media/disk/MySQL_data/ and deleted all files like ibdata1,
> ib_logfile0, and ib_logfile1.
>
> I then edit /etc/mysql/my.conf and update the "datadir" to my new
> directory. I also update /etc/apparmor.d/usr.sbin.mysql so that news
> lines with /var/lib/mysql replaced by /media/disk/MySQL_data are
> added.
>
> However, after sudo /etc/init.d/apparmor reload
>
> I try sudo /etc/init.d/mysql start
>
> I got
> * Starting MySQL database server mysqld
>         [fail]
>
> If I change the "datadir" line in /etc/mysql/my.conf back to the
> original one, I can start MySQL successfully.
>
> I think I have done everything needed to change MySQL data directory.
>
> Why am I still getting this error?  Where can I start to look for the causes?
>
> Thanks.
>
> Jia
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>

-- 
-----------------------------
Johnny Withers
601.209.4985
johnny@stripped
Thread
Fail to change MySQL data directory on ubuntuchen jia26 Aug
  • Re: Fail to change MySQL data directory on ubuntuJohnny Withers26 Aug
    • Re: Fail to change MySQL data directory on ubuntuJia Chen26 Aug
      • Re: Fail to change MySQL data directory on ubuntuJohnny Withers26 Aug
        • Re: Fail to change MySQL data directory on ubuntuJohnny Withers26 Aug
          • Re: Fail to change MySQL data directory on ubuntuJia Chen26 Aug
  • Re: Fail to change MySQL data directory on ubuntuClaudio Nanni27 Aug
    • Re: Fail to change MySQL data directory on ubuntuJia Chen27 Aug
      • Re: Fail to change MySQL data directory on ubuntuEric Bergen27 Aug
        • Re: Fail to change MySQL data directory on ubuntuJia Chen27 Aug
          • Re: Fail to change MySQL data directory on ubuntuJohnny Withers28 Aug
            • Re: Fail to change MySQL data directory on ubuntuchen jia29 Aug