views:

664

answers:

2

I've bee tearing my hair out trying to get MySQL 5 running on CentOS 5 but I've had hardly any luck. If I leave everything as default, and launch the initial install it works a charm, but if I tell the my.cnf to use a different drive to store the data, I continuously get the "Timeout error occurred trying to start MySQL Daemon." error.

My.cnf is as follows:

[mysqld]
datadir=/database/mysql
socket=/database/mysql/mysql.sock
user=mysql
old_passwords=1
log-error=/database/log/mysqld.log
long_query_time  = 10
log_slow_queries = /database/log/mysql-slow.log
query-cache-type = 1
query-cache-size = 8M
innodb_file_per_table
skip-bdb
set-variable = local-infile=0

[mysqld_safe]
pid-file=/var/run/mysqld/mysqld.pid

The folders all have the right privileges and the mysqld.log doesn't have any error messages in there, according to it, MySQL launced successfuly. Oh, and /database is a mounted drive, but even if I trial it on a local directory, I get the same error.

Any ideas what could be going wrong? i've seriously waisted more than 5 hours on this now :(

CHEERS

A: 

Shouldn't the datadir be set to the other drive and everything else (socket) point to the standard install locations?

tom
Yeah, i've tried that, but the init.d script looks for the socket in the data directory by default, so it would need to live in both... which potentially leads to migration/upgrade issues
d2kagw
That doesn't sound right. Did you add the standard socket param in my.cnf not just remove it?
tom
The custom one that is.
tom
you were right in the end, I just pointed the data directory to the new mount and put in the variable for the socket which kept it in the default location and it works a treat.
d2kagw
A: 

Did you check selinux settings? Make sure it is disabled (setenforce disabled), or spent some time learn about it (chcon command) To disable on boot look into /etc/sysconfig

Run the command : getenforce, if it says "Enforced", SE-Linux is On