Fail to change MySQL data directory on ubuntu
Fail to change MySQL data directory on ubuntu
am 26.08.2009 02:46:28 von chen jia
Hi there,
I am using MySQL on ubuntu 8.04.
I followed this link
http://www.ubuntu-howto.info/howto/how-to-move-mysql-databas es-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=gcdmg-mysql-2@m.gmane.org
Re: Fail to change MySQL data directory on ubuntu
am 26.08.2009 03:40:03 von Johnny Withers
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 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-databas es-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
> =A0 =A0 =A0 =A0[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? =A0Where can I start to look for the c=
auses?
>
> Thanks.
>
> Jia
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixela=
ted.net
>
>
--=20
-----------------------------
Johnny Withers
601.209.4985
johnny@pixelated.net
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: Fail to change MySQL data directory on ubuntu
am 26.08.2009 04:23:41 von chen jia
I run sudo /etc/init.d/mysql start and check the syslog by running sudo
tail -f /var/log/syslog
This is what I get
Aug 25 22:18:06 chenj-desktop mysqld_safe[10934]: started
Aug 25 22:18:06 chenj-desktop kernel: [11083.933531] type=1503
audit(1251253086.020:43): operation="inode_create" requested_mask="a::"
denied_mask="a::" fsuid=0
name="/home/chenj/MySQL_data/chenj-desktop.lower-test" pid=10936
profile="/usr/sbin/mysqld"
Aug 25 22:18:06 chenj-desktop kernel: [11083.933581] type=1503
audit(1251253086.020:44): operation="inode_create" requested_mask="a::"
denied_mask="a::" fsuid=0
name="/home/chenj/MySQL_data/chenj-desktop.lower-test" pid=10936
profile="/usr/sbin/mysqld"
Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning]
option 'thread_stack': unsigned value 128 adjusted to 131072
Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning]
Can't create test file /home/chenj/MySQL_data/chenj-desktop.lower-test
Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning]
Can't create test file /home/chenj/MySQL_data/chenj-desktop.lower-test
Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 InnoDB:
Operating system error number 13 in a file operation.
Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: The error means
mysqld does not have the access rights to
Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: the directory.
Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File name ./ibdata1
Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File operation
call: 'create'.
Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: Cannot continue
operation.
Aug 25 22:18:06 chenj-desktop kernel: [11083.962674] type=1503
audit(1251253086.048:45): operation="inode_create" requested_mask="a::"
denied_mask="a::" fsuid=110 name="/home/chenj/MySQL_data/ibdata1"
pid=10936 profile="/usr/sbin/mysqld"
Aug 25 22:18:06 chenj-desktop mysqld_safe[10944]: ended
Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: 0 processes
alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
ping' resulted in
Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: error: 'Can't
connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)'
Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: Check that
mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
Does this message tell me any thing about the problem? Thanks.
Best,
Jia
Johnny Withers wrote:
> 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 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-databas es-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=johnny@pixelated.net
>>
>>
>>
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Fail to change MySQL data directory on ubuntu
am 26.08.2009 15:02:45 von Johnny Withers
Yes, error 13, permission denied. Check selinux setup. I had this same
problem last week on a CentOS machine. I had to change the object type
of the new data dir to mysqld-something. I'm on a mobile phone and
can't remember the exact cmd.
On Tuesday, August 25, 2009, Jia Chen wrote:
> I run sudo /etc/init.d/mysql start and check the syslog by running sudo t=
ail -f /var/log/syslog
>
> This is what I get
> Aug 25 22:18:06 chenj-desktop mysqld_safe[10934]: started
> Aug 25 22:18:06 chenj-desktop kernel: [11083.933531] type=3D1503 audit(12=
51253086.020:43): operation=3D"inode_create" requested_mask=3D"a::" denied_=
mask=3D"a::" fsuid=3D0 name=3D"/home/chenj/MySQL_data/chenj-desktop.lower-t=
est" pid=3D10936 profile=3D"/usr/sbin/mysqld"
> Aug 25 22:18:06 chenj-desktop kernel: [11083.933581] type=3D1503 audit(12=
51253086.020:44): operation=3D"inode_create" requested_mask=3D"a::" denied_=
mask=3D"a::" fsuid=3D0 name=3D"/home/chenj/MySQL_data/chenj-desktop.lower-t=
est" pid=3D10936 profile=3D"/usr/sbin/mysqld"
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning] op=
tion 'thread_stack': unsigned value 128 adjusted to 131072
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning] Ca=
n't create test file /home/chenj/MySQL_data/chenj-desktop.lower-test
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning] Ca=
n't create test file /home/chenj/MySQL_data/chenj-desktop.lower-test
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 =A0InnoDB: O=
perating system error number 13 in a file operation.
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: The error means mysq=
ld does not have the access rights to
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: the directory.
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File name ./ibdata1
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File operation call:=
'create'.
> Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: Cannot continue oper=
ation.
> Aug 25 22:18:06 chenj-desktop kernel: [11083.962674] type=3D1503 audit(12=
51253086.048:45): operation=3D"inode_create" requested_mask=3D"a::" denied_=
mask=3D"a::" fsuid=3D110 name=3D"/home/chenj/MySQL_data/ibdata1" pid=3D1093=
6 profile=3D"/usr/sbin/mysqld"
> Aug 25 22:18:06 chenj-desktop mysqld_safe[10944]: ended
> Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: 0 processes alive=
and '/usr/bin/mysqladmin --defaults-file=3D/etc/mysql/debian.cnf ping' res=
ulted in
> Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: ^G/usr/bin/mysqla=
dmin: connect to server at 'localhost' failed
> Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: error: 'Can't con=
nect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)=
'
> Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: Check that mysqld=
is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
> Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
>
> Does this message tell me any thing about the problem? =A0Thanks.
>
> Best,
> Jia
>
> Johnny Withers wrote:
>
> 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 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-databas es-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
> =A0 =A0 =A0 =A0[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? =A0Where can I start to look for the c=
auses?
>
> Thanks.
>
> Jia
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixela=
ted.net
>
>
>
>
>
>
>
>
>
--=20
-----------------------------
Johnny Withers
601.209.4985
johnny@pixelated.net
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: Fail to change MySQL data directory on ubuntu
am 26.08.2009 16:03:25 von Johnny Withers
--0016e6d99c4b284e3c04720bea38
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I'm at work now, this is the cmd I used:
chcon -R -u system_u -r object_r -t mysql_db_t /data
(my data lives in /data/mysqlXX -- were XX is the server version)
On Wed, Aug 26, 2009 at 8:02 AM, Johnny Withers wrote:
> Yes, error 13, permission denied. Check selinux setup. I had this same
> problem last week on a CentOS machine. I had to change the object type
> of the new data dir to mysqld-something. I'm on a mobile phone and
> can't remember the exact cmd.
>
>
> On Tuesday, August 25, 2009, Jia Chen wrote:
> > I run sudo /etc/init.d/mysql start and check the syslog by running sudo
> tail -f /var/log/syslog
> >
> > This is what I get
> > Aug 25 22:18:06 chenj-desktop mysqld_safe[10934]: started
> > Aug 25 22:18:06 chenj-desktop kernel: [11083.933531] type=1503
> audit(1251253086.020:43): operation="inode_create" requested_mask="a::"
> denied_mask="a::" fsuid=0
> name="/home/chenj/MySQL_data/chenj-desktop.lower-test" pid=10936
> profile="/usr/sbin/mysqld"
> > Aug 25 22:18:06 chenj-desktop kernel: [11083.933581] type=1503
> audit(1251253086.020:44): operation="inode_create" requested_mask="a::"
> denied_mask="a::" fsuid=0
> name="/home/chenj/MySQL_data/chenj-desktop.lower-test" pid=10936
> profile="/usr/sbin/mysqld"
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning]
> option 'thread_stack': unsigned value 128 adjusted to 131072
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning]
> Can't create test file /home/chenj/MySQL_data/chenj-desktop.lower-test
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 [Warning]
> Can't create test file /home/chenj/MySQL_data/chenj-desktop.lower-test
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06 InnoDB:
> Operating system error number 13 in a file operation.
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: The error means
> mysqld does not have the access rights to
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: the directory.
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File name ./ibdata1
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File operation call:
> 'create'.
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: Cannot continue
> operation.
> > Aug 25 22:18:06 chenj-desktop kernel: [11083.962674] type=1503
> audit(1251253086.048:45): operation="inode_create" requested_mask="a::"
> denied_mask="a::" fsuid=110 name="/home/chenj/MySQL_data/ibdata1" pid=10936
> profile="/usr/sbin/mysqld"
> > Aug 25 22:18:06 chenj-desktop mysqld_safe[10944]: ended
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: 0 processes alive
> and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping'
> resulted in
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
> ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: error: 'Can't
> connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
> (2)'
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: Check that mysqld
> is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
> >
> > Does this message tell me any thing about the problem? Thanks.
> >
> > Best,
> > Jia
> >
> > Johnny Withers wrote:
> >
> > 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 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-databas es-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=johnny@pixelated.net
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> -----------------------------
> Johnny Withers
> 601.209.4985
> johnny@pixelated.net
>
--
-----------------------------
Johnny Withers
601.209.4985
johnny@pixelated.net
--0016e6d99c4b284e3c04720bea38--
Re: Fail to change MySQL data directory on ubuntu
am 26.08.2009 16:24:33 von chen jia
Hi Johnny,
Thanks you so much!
Your command fixed the problem beautifully. Now, MySQL can start
successfully. I can create and drop databases without problem. Thanks again.
Best,
Jia
Johnny Withers wrote:
> I'm at work now, this is the cmd I used:
>
> chcon -R -u system_u -r object_r -t mysql_db_t /data
> (my data lives in /data/mysqlXX -- were XX is the server version)
>
> On Wed, Aug 26, 2009 at 8:02 AM, Johnny Withers
> > wrote:
>
> Yes, error 13, permission denied. Check selinux setup. I had this same
> problem last week on a CentOS machine. I had to change the object type
> of the new data dir to mysqld-something. I'm on a mobile phone and
> can't remember the exact cmd.
>
>
> On Tuesday, August 25, 2009, Jia Chen
> > wrote:
> > I run sudo /etc/init.d/mysql start and check the syslog by
> running sudo tail -f /var/log/syslog
> >
> > This is what I get
> > Aug 25 22:18:06 chenj-desktop mysqld_safe[10934]: started
> > Aug 25 22:18:06 chenj-desktop kernel: [11083.933531] type=1503
> audit(1251253086.020:43): operation="inode_create"
> requested_mask="a::" denied_mask="a::" fsuid=0
> name="/home/chenj/MySQL_data/chenj-desktop.lower-test" pid=10936
> profile="/usr/sbin/mysqld"
> > Aug 25 22:18:06 chenj-desktop kernel: [11083.933581] type=1503
> audit(1251253086.020:44): operation="inode_create"
> requested_mask="a::" denied_mask="a::" fsuid=0
> name="/home/chenj/MySQL_data/chenj-desktop.lower-test" pid=10936
> profile="/usr/sbin/mysqld"
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06
> [Warning] option 'thread_stack': unsigned value 128 adjusted to 131072
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06
> [Warning] Can't create test file
> /home/chenj/MySQL_data/chenj-desktop.lower-test
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06
> [Warning] Can't create test file
> /home/chenj/MySQL_data/chenj-desktop.lower-test
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: 090825 22:18:06
> InnoDB: Operating system error number 13 in a file operation.
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: The error
> means mysqld does not have the access rights to
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: the directory.
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File name
> ./ibdata1
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: File
> operation call: 'create'.
> > Aug 25 22:18:06 chenj-desktop mysqld[10937]: InnoDB: Cannot
> continue operation.
> > Aug 25 22:18:06 chenj-desktop kernel: [11083.962674] type=1503
> audit(1251253086.048:45): operation="inode_create"
> requested_mask="a::" denied_mask="a::" fsuid=110
> name="/home/chenj/MySQL_data/ibdata1" pid=10936
> profile="/usr/sbin/mysqld"
> > Aug 25 22:18:06 chenj-desktop mysqld_safe[10944]: ended
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: 0
> processes alive and '/usr/bin/mysqladmin
> --defaults-file=/etc/mysql/debian.cnf ping' resulted in
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
> ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: error:
> 'Can't connect to local MySQL server through socket
> '/var/run/mysqld/mysqld.sock' (2)'
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]: Check
> that mysqld is running and that the socket:
> '/var/run/mysqld/mysqld.sock' exists!
> > Aug 25 22:18:20 chenj-desktop /etc/init.d/mysql[11094]:
> >
> > Does this message tell me any thing about the problem? Thanks.
> >
> > Best,
> > Jia
> >
> > Johnny Withers wrote:
> >
> > 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
> > 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-databas es-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=johnny@pixelated.net
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> -----------------------------
> Johnny Withers
> 601.209.4985
> johnny@pixelated.net
>
>
>
>
> --
> -----------------------------
> Johnny Withers
> 601.209.4985
> johnny@pixelated.net
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Fail to change MySQL data directory on ubuntu
am 27.08.2009 09:59:57 von Claudio Nanni - TomTom
--0015175cad8c1f658204721af437
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
2009/8/26 chen jia
> Hi there,
>
> I am using MySQL on ubuntu 8.04.
>
> I followed this link
>
> http://www.ubuntu-howto.info/howto/how-to-move-mysql-databas es-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,
Chen, Did you really delete 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=claudio.nanni@gmail.com
>
>
--0015175cad8c1f658204721af437--
Re: Fail to change MySQL data directory on ubuntu
am 27.08.2009 16:56:58 von chen jia
> Chen, Did you really delete ibdata1 ?
Yes, I did.
Best,
Jia
Claudio Nanni wrote:
>
>
> 2009/8/26 chen jia >
>
> Hi there,
>
> I am using MySQL on ubuntu 8.04.
>
> I followed this link
> http://www.ubuntu-howto.info/howto/how-to-move-mysql-databas es-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,
>
>
> Chen, Did you really delete 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=claudio.nanni@gmail.com
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Fail to change MySQL data directory on ubuntu
am 27.08.2009 19:51:15 von Eric Bergen
That procedure is horribly incorrect. You should simply move the
ib_log and ibdata files with the rest of the datadir. The ibdata1 file
contains innodb's system tables and depending on your setting of
innodb_file_per_table it also contains your data!
On Thu, Aug 27, 2009 at 7:56 AM, Jia Chen wrote:
>> Chen, Did you really delete ibdata1 ?
>
> Yes, I did.
>
> Best,
> Jia
>
>
> Claudio Nanni wrote:
>>
>>
>> 2009/8/26 chen jia >
>>
>> =A0 =A0Hi there,
>>
>> =A0 =A0I am using MySQL on ubuntu 8.04.
>>
>> =A0 =A0I followed this link
>>
>> =A0http://www.ubuntu-howto.info/howto/how-to-move-mysql-data bases-to-ano=
ther-location-partition-or-hard-drive
>> =A0 =A0to change the data directory of MySQL.
>>
>> =A0 =A0After stopping MySQL: sudo /etc/init.d/mysql stop
>>
>> =A0 =A0I make a new directory: sudo mkdir /media/disk/MySQL_data
>>
>> =A0 =A0then change the ownership of new directory, sudo chown mysql:mysq=
l
>> =A0 =A0/media/disk/MySQL_data
>>
>> =A0 =A0and copy all data to the new directory, cp -r -p /var/lib/mysql/*
>> =A0 =A0/media/disk/MySQL_data/ and deleted all files like ibdata1,
>>
>>
>> Chen, Did you really delete ibdata1 ?
>>
>>
>>
>>
>>
>>
>> =A0 =A0ib_logfile0, and ib_logfile1.
>>
>> =A0 =A0I then edit /etc/mysql/my.conf and update the "datadir" to my new
>> =A0 =A0directory. I also update /etc/apparmor.d/usr.sbin.mysql so that n=
ews
>> =A0 =A0lines with /var/lib/mysql replaced by /media/disk/MySQL_data are
>> =A0 =A0added.
>>
>> =A0 =A0However, after sudo /etc/init.d/apparmor reload
>>
>> =A0 =A0I try sudo /etc/init.d/mysql start
>>
>> =A0 =A0I got
>> =A0 =A0* Starting MySQL database server mysqld
>> =A0 =A0 =A0 =A0 =A0 [fail]
>>
>> =A0 =A0If I change the "datadir" line in /etc/mysql/my.conf back to the
>> =A0 =A0original one, I can start MySQL successfully.
>>
>> =A0 =A0I think I have done everything needed to change MySQL data direct=
ory.
>>
>> =A0 =A0Why am I still getting this error? =A0Where can I start to look f=
or
>> =A0 =A0the causes?
>>
>> =A0 =A0Thanks.
>>
>> =A0 =A0Jia
>>
>> =A0 =A0--
>> =A0 =A0MySQL General Mailing List
>> =A0 =A0For list archives: http://lists.mysql.com/mysql
>> =A0 =A0To unsubscribe:
>> http://lists.mysql.com/mysql?unsub=3Dclaudio.nanni@gmail.com
>>
>>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Deric.bergen@g=
mail.com
>
>
--=20
Eric Bergen
eric.bergen@gmail.com
http://www.ebergen.net
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: Fail to change MySQL data directory on ubuntu
am 27.08.2009 20:15:26 von chen jia
Thanks for the tips. Where can I find more details about the ibdata file?
After I changed the data dir, hese file did get recreated. So far, I
have not noticed any data loss yet.
Best,
Jia
Eric Bergen wrote:
> That procedure is horribly incorrect. You should simply move the
> ib_log and ibdata files with the rest of the datadir. The ibdata1 file
> contains innodb's system tables and depending on your setting of
> innodb_file_per_table it also contains your data!
>
> On Thu, Aug 27, 2009 at 7:56 AM, Jia Chen wrote:
>
>>> Chen, Did you really delete ibdata1 ?
>>>
>> Yes, I did.
>>
>> Best,
>> Jia
>>
>>
>> Claudio Nanni wrote:
>>
>>> 2009/8/26 chen jia >
>>>
>>> Hi there,
>>>
>>> I am using MySQL on ubuntu 8.04.
>>>
>>> I followed this link
>>>
>>> http://www.ubuntu-howto.info/howto/how-to-move-mysql-databas es-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,
>>>
>>>
>>> Chen, Did you really delete 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=claudio.nanni@gmail.com
>>>
>>>
>>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: http://lists.mysql.com/mysql?unsub=eric.bergen@gmail.com
>>
>>
>>
>
>
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Fail to change MySQL data directory on ubuntu
am 28.08.2009 14:25:48 von Johnny Withers
Maybe you do not use innodb tables, in that case there would be no data los=
s.
On Thursday, August 27, 2009, Jia Chen wrote:
> Thanks for the tips. Where can I find more details about the ibdata file?
>
> After I changed the data dir, hese file did get recreated. So far, I have=
not noticed any data loss yet.
>
> Best,
> Jia
>
> Eric Bergen wrote:
>
> That procedure is horribly incorrect. You should simply move the
> ib_log and ibdata files with the rest of the datadir. The ibdata1 file
> contains innodb's system tables and depending on your setting of
> innodb_file_per_table it also contains your data!
>
> On Thu, Aug 27, 2009 at 7:56 AM, Jia Chen wrote:
>
>
> Chen, Did you really delete ibdata1 ?
>
>
> Yes, I did.
>
> Best,
> Jia
>
>
> Claudio Nanni wrote:
>
>
> 2009/8/26 chen jia >
>
> =A0 Hi there,
>
> =A0 I am using MySQL on ubuntu 8.04.
>
> =A0 I followed this link
>
> =A0http://www.ubuntu-howto.info/howto/how-to-move-mysql-data bases-to-anot=
her-location-partition-or-hard-drive
> =A0 to change the data directory of MySQL.
>
> =A0 After stopping MySQL: sudo /etc/init.d/mysql stop
>
> =A0 I make a new directory: sudo mkdir /media/disk/MySQL_data
>
> =A0 then change the ownership of new directory, sudo chown mysql:mysql
> =A0 /media/disk/MySQL_data
>
> =A0 and copy all data to the new directory, cp -r -p /var/lib/mysql/*
> =A0 /media/disk/MySQL_data/ and deleted all files like ibdata1,
>
>
> Chen, Did you really delete ibdata1 ?
>
>
>
>
>
>
> =A0 ib_logfile0, and ib_logfile1.
>
> =A0 I then edit /etc/mysql/my.conf and update the "datadir" to my new
> =A0 directory. I also update /etc/apparmor.d/usr.sbin.mysql so that news
> =A0 lines with /var/lib/mysql replaced by /media/disk/MySQL_data are
> =A0 added.
>
> =A0 However, after sudo /etc/init.d/apparmor reload
>
> =A0 I try sudo /etc/init.d/mysql start
>
> =A0 I got
> =A0 * Starting MySQL database server mysqld
> =A0 =A0 =A0 =A0 =A0[fail]
>
> =A0 If I change the "datadir" line in /etc/mysql/my.conf back to the
> =A0 original one, I can start MySQL successfully.
>
> =A0 I think I have done everything needed to change MySQL data directory=
..
>
> =A0 Why am I still getting this error? =A0Where can I start to look for
> =A0 the causes?
>
> =A0 Thanks.
>
> =A0 Jia
>
> =A0 --
> =A0 MySQL General Mailing List
> =A0 For list archives: http://lists.mysql.com/mysql
> =A0 To unsubscribe:
> http://lists.mysql.com/mysql?unsub=3Dclaudio.nanni@gmail.com
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Deric.bergen@g=
mail.com
>
>
>
>
>
>
>
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixela=
ted.net
>
>
--=20
-----------------------------
Johnny Withers
601.209.4985
johnny@pixelated.net
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: Fail to change MySQL data directory on ubuntu
am 29.08.2009 02:36:25 von chen jia
That is likely the case. As you said, I do not use innodb tables.
Best,
Jia
On Fri, Aug 28, 2009 at 8:25 AM, Johnny Withers wrote=
:
> Maybe you do not use innodb tables, in that case there would be no data l=
oss.
>
> On Thursday, August 27, 2009, Jia Chen wrote:
>> Thanks for the tips. Where can I find more details about the ibdata file=
?
>>
>> After I changed the data dir, hese file did get recreated. So far, I hav=
e not noticed any data loss yet.
>>
>> Best,
>> Jia
>>
>> Eric Bergen wrote:
>>
>> That procedure is horribly incorrect. You should simply move the
>> ib_log and ibdata files with the rest of the datadir. The ibdata1 file
>> contains innodb's system tables and depending on your setting of
>> innodb_file_per_table it also contains your data!
>>
>> On Thu, Aug 27, 2009 at 7:56 AM, Jia Chen wrote:
>>
>>
>> Chen, Did you really delete ibdata1 ?
>>
>>
>> Yes, I did.
>>
>> Best,
>> Jia
>>
>>
>> Claudio Nanni wrote:
>>
>>
>> 2009/8/26 chen jia >
>>
>> Hi there,
>>
>> I am using MySQL on ubuntu 8.04.
>>
>> I followed this link
>>
>> =A0http://www.ubuntu-howto.info/howto/how-to-move-mysql-data bases-to-ano=
ther-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:mysq=
l
>> /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,
>>
>>
>> Chen, Did you really delete 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 n=
ews
>> 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
>> =A0 =A0 =A0 =A0[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 direct=
ory.
>>
>> Why am I still getting this error? =A0Where can I start to look f=
or
>> the causes?
>>
>> Thanks.
>>
>> Jia
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:
>> http://lists.mysql.com/mysql?unsub=3Dclaudio.nanni@gmail.com
>>
>>
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Deric.bergen@=
gmail.com
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixel=
ated.net
>>
>>
>
> --
> -----------------------------
> Johnny Withers
> 601.209.4985
> johnny@pixelated.net
>
--=20
Ohio State University - Finance
248 Fisher Hall
2100 Neil Ave.
Columbus, Ohio 43210
Telephone: 614-292-2979
http://www.fisher.osu.edu/~chen_1002/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg