On a new RH7 installation and were MySQL has been upgraded with the new rpm's (version 3.23.24-1) the safe_mysqld will not start MySQL. I can run the script /usr/bin/mysql_install_db with no errors. When I then try to start the database, I run the script /usr/bin/safe_mysqld, but the mysqld will not start. In /var/lib/mysql/<servername>.err I get the following message: mysqld started /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) mysqld ended I have tried to change permision on the /var/lib/mysql directory, but MySQL will only start if I type: chmod 777 -R mysql/ After this I can run safe_mysqld without problems.
Try "service mysqld start" - this is the supported way, doing it manually requires proper permissions on directories and support files (pid files, logs, etc)
To test I made a new installation with the your updated rpm's and then I tried to start the server as suggested. It didn't work. The last linies of the file <servername>.err in /var/lib/mysql shows the following: Number of processes running now: 0 001030 12:59:41 mysqld restarted 001030 12:59:42 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) 001030 12:59:42 /usr/libexec/mysqld: Error on delete of '/var/run/mysqld.pid' (Errcode: 13) Number of processes running now: 0 001030 12:59:42 mysqld restarted 001030 12:59:42 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) 001030 12:59:42 /usr/libexec/mysqld: Error on delete of '/var/run/mysqld.pid' (Errcode: 13) Number of processes running now: 0 001030 12:59:42 mysqld restarted 001030 12:59:42 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) 001030 12:59:42 /usr/libexec/mysqld: Error on delete of '/var/run/mysqld.pid' (Errcode: 13) Number of processes running now: 0 001030 12:59:42 mysqld restarted 001030 12:59:42 /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) 001030 12:59:42 /usr/libexec/mysqld: Error on delete of '/var/run/mysqld.pid' (Errcode: 13) The problem is still permissions. After the basic installation the permission on /var/lib/mysql was drwx------ With the updated rpm's the permission on /var/lib/mysql was drwxr-xr-x, but on the directory with the database /var/lib/mysql/mysql the permissions is drwx---- -- It will work if I type cd /var/lib/mysql chmod 777 mysql What should the permissions be for this directory?
It needs to be 755 and owned by mysql(the user which runs the database) - nobody but this user are supposed to be able to write to this directory. Running safe_mysqld is not supported, and the service needs be started by root (the startup scripts sus the database startup. It looks like you try from another user, and this isn't supported.