Hello, I have been trying to change the directory of my databases for mysql with no success.
I have changed the directories in /etc/my.cnf to the new directory.
Code:
[mysqld]
# datadir=/var/lib/mysql
# socket=/var/lib/mysql/mysql.sock
datadir=/home/mc/mysql
socket=/home/mc/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
I changed the owner and permissions for the folder and everything in the folder.
Code:
[root@localhost ~]# ls -l /home/mc/mysql
total 266272
drwx------. 2 mysql mysql 4096 Nov 6 01:32 creativecontrol
-rwx------. 1 mysql mysql 262144000 Nov 6 01:32 ibdata1
-rwx------. 1 mysql mysql 5242880 Nov 6 01:32 ib_logfile0
-rwx------. 1 mysql mysql 5242880 Nov 6 01:32 ib_logfile1
drwx------. 2 mysql mysql 4096 Nov 6 01:32 iconomy
drwx------. 2 mysql mysql 4096 Nov 6 01:32 jobs
drwx------. 2 mysql mysql 4096 Nov 6 01:32 logblock
drwx------. 2 mysql mysql 4096 Nov 6 01:32 lwc
drwx------. 2 mysql mysql 4096 Nov 6 01:32 mysql
drwx------. 2 mysql mysql 4096 Nov 6 01:32 towny
Yet when I try to start the mysqld service I get this in the mysql.log
Code:
121106 02:10:56 mysqld_safe Starting mysqld daemon with databases from /home/mc/mysql
121106 2:10:56 [Warning] Can't create test file /home/mc/mysql/localhost.lower-test
121106 2:10:56 [Warning] Can't create test file /home/mc/mysql/localhost.lower-test
121106 2:10:56 InnoDB: Initializing buffer pool, size = 8.0M
121106 2:10:56 InnoDB: Completed initialization of buffer pool
121106 2:10:56 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
121106 02:10:56 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
I am clueless to why it does not have permissions in the directory? I gave ownership and 700 permissions on that directory.