Can't move the MYSQL database files
Posted: 2009/11/08 17:12:49
Hey all,
Here is my query (ya pun intended)
Anyway, I just installed mysql and need to move the databases to a new location. I say 'no problem'
I shutdown mysql (service mysqld stop)
I configure my.cnf to point to the new location, which in my case is: /mnt/data/mysql. I know not very original naming.
I do the old chown -R mysql:mysql /mnt/datal/mysql AND I copy all the files over (cp -R /var/lib/mysql /mnt/cgsvol/mysql)
chmod 777 /mnt/data/mysql (I know that's overkill but I was getting frustrated)
I ensure the chown worked (ls -a -l) and the files are there from the old directory.
Now...would ya believe it, I can't load the daemon again.
I check the log (/var/log/mysqld.log) and it can't write any test file to that directory.
Of course I change /etc/my.cnf back to the old directory and everyone is happy -- well except me.
So of course, I'm thinking selinux. Ya...but selinux has always been bad breakfast food for me. I know enough to remove it, but I actually don't want to do that...I do like it but there must be SOMETHING I can do in selinux. Now I could be wrong...let me know. What do you think is the problem?
Thanks as always,
(log file exact data).
091107 23:22:21 mysqld started
091107 23:22:22 [Warning] option 'max_join_size': unsigned value 18446744073709$
091107 23:22:22 [Warning] option 'max_join_size': unsigned value 18446744073709$
091107 23:22:22 [Warning] Can't create test file /mnt/data/mysql/LittleJupiter.$
091107 23:22:22 [Warning] Can't create test file /mnt/data/mysql/LittleJupiter.$
^G/usr/libexec/mysqld: Can't change dir to '/mnt/data/mysql/' (Errcode: 13)
091107 23:22:22 [ERROR] Aborting
Here is my query (ya pun intended)
Anyway, I just installed mysql and need to move the databases to a new location. I say 'no problem'
I shutdown mysql (service mysqld stop)
I configure my.cnf to point to the new location, which in my case is: /mnt/data/mysql. I know not very original naming.
I do the old chown -R mysql:mysql /mnt/datal/mysql AND I copy all the files over (cp -R /var/lib/mysql /mnt/cgsvol/mysql)
chmod 777 /mnt/data/mysql (I know that's overkill but I was getting frustrated)
I ensure the chown worked (ls -a -l) and the files are there from the old directory.
Now...would ya believe it, I can't load the daemon again.
I check the log (/var/log/mysqld.log) and it can't write any test file to that directory.
Of course I change /etc/my.cnf back to the old directory and everyone is happy -- well except me.
So of course, I'm thinking selinux. Ya...but selinux has always been bad breakfast food for me. I know enough to remove it, but I actually don't want to do that...I do like it but there must be SOMETHING I can do in selinux. Now I could be wrong...let me know. What do you think is the problem?
Thanks as always,
(log file exact data).
091107 23:22:21 mysqld started
091107 23:22:22 [Warning] option 'max_join_size': unsigned value 18446744073709$
091107 23:22:22 [Warning] option 'max_join_size': unsigned value 18446744073709$
091107 23:22:22 [Warning] Can't create test file /mnt/data/mysql/LittleJupiter.$
091107 23:22:22 [Warning] Can't create test file /mnt/data/mysql/LittleJupiter.$
^G/usr/libexec/mysqld: Can't change dir to '/mnt/data/mysql/' (Errcode: 13)
091107 23:22:22 [ERROR] Aborting