Start MySQL with a non-default datadir
Hi,
I've just installed RedHat Enterprise WS v4 with both MySQL client and server rpms. The default installation sets the datadir at /var/lib/mysql. I would like the data directory to instead by /home/mysql (home is a larger partition). First, let me point out that if I change nothing from the default install and run /etc/init.d/mysqld start, everything works and I can access mysql. However, when I go and edit the file /etc/my.cnf bad things begin to happen. First I stopped the mysql damean, then I edited the /etc/my.cnf file so it looked like: Code:
[mysqld] Quote:
Quote:
-NifflerX |
can you run mysql with a few -v's on the command line for a little more information?
|
Thanks for replying.
When I try to run mysql with my /etc/my.cnf file looking as it does above I get the following: Quote:
When I reset the /etc/my.cnf file to the original I get the following: Quote:
-NifflerX |
sorry for the confusion, i meant the mysqld_safe daemon.
|
No problem. Here's the results of the mysqld_safe command with /etc/my.cnf as above:
Quote:
Here's the results with /etc/my.cnf as the original: Quote:
-NifflerX |
Hi,
I'm still working on the same problem as before, and I've currently got the my.cnf file looking as it does above, with the datadir=/home/mysql. However, today when I ran /etc/init.d/mysqld start I got a very different error response. I've posted it below. Quote:
-NifflerX |
This isn't exactly a solution, but here is what I did to finally get it to work. I downloaded that latest stable version from mysql.com and installed that as per the instructions. Then I started mysql. It ran without a problem from the datadir I definted in /etc/my.cnf. I'm not sure what the problem was, but for whatever reason, the mysql that came installed via the redhat installation disks just would not work.
-NifflerX |
its because rhel 4 has selinux installed with it You need to disable it
try setsebool -P mysqld_disable_trans=1 |
When I moved my data directory, the only setting I changed in the config file was the location of the data directory. I didn't modify anything else. I also made sure that the new data directory had the same permissions as the default data directory. All went well after that.
|
Yeah but the newer version of linux has selinux installed. If that is it uses user mysqld_t which doesnt have permissions there. You can either shut selinux off totally - use the command i said or you will need to reflag files.
|
All times are GMT -5. The time now is 06:49 PM. |