Having troubles changing the database directory for mysql
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] Code:
[root@localhost ~]# ls -l /home/mc/mysql Code:
121106 02:10:56 mysqld_safe Starting mysqld daemon with databases from /home/mc/mysql |
From the logfile it really looks to be a permission problem. My guess is that the mysql user can't write to some file or directory in /home/mc/mysql. Double check all your permissions, even hidden files and make sure to chmod recursively.
1) What operating system are you running? This is important. 2) Have you migrated the pre-existing database data? |
Quote:
2) Yes I copied the whole directory with Code:
cp -R /var/lib/mysql/ /home/mc/mysql/ |
Looks lie SELinux
Code:
cd /var/lib/mysql In any case, why would you want to do this; its only going to cause confusion/issues... |
Quote:
This seemed like the easiest way to get the databases on my HDD since my /home directory is on my 2nd hard drive. Also I just assumed, since I am running a game server, that if I put mysql on my second hard drive it would help because the game server is running off the SSD and using the HDD for mysql would help reduce the I/O usage on the SSD. |
mysql is being started as the user mysql. I would guess that even though mysql might have permissions to /home/mc/mysql it still does not have permissions to access /home/mc. I would not suggest changing your users home directory permissions.
It is possible to run mysqld as any regular user. Be sure to change the msqld data permissions appropriately for whatever user you choose. http://dev.mysql.com/doc/refman/5.5/...ysql-user.html |
I'd move the whole of /var to go on the HDD in that case; that's where the logs for everything go. Its gets a lot of i/o usage.
|
Quote:
I tried to look up how to move directories to another hard drive but I could not figure out how to, so I resorted to this. That would make things a whole lot simpler. |
Should I make a new thread? For asking how to move the /var directory?
|
All times are GMT -5. The time now is 10:32 PM. |