1

I have a CentOS 6.7 server with MySQL 5.1.73 installed.

I am trying to enable replication which fails because "mysqld_safe" cannot write to "/var/log/mysql/mysql-bin.index"; even though the directory exists and permissions as "drw-r-----".

If I "su mysql" then I cannot even list the contents...

SELinux is disabled (and rebooted system) so I cannot see what is wrong. Any ideas?

justacodemonkey
  • 153
  • 1
  • 7
  • 1
    Who is the user of /var/log/mysql? Maybe you started the mysql daemon as root and it took owner ship over log files. – cristi Nov 09 '15 at 14:36

1 Answers1

0

Your permissions on /var/lib/mysql are not default, it's probably a good idea to set them back to defaults and then get things working before trying to erm lock them down

ls -ld /var/lib/mysql
drwxr-xr-x. 5 mysql mysql 4096 Aug 17 11:10 /var/lib/mysql

chmod 755 /var/lib/mysql
chown mysql:mysql /var/lib/mysql
  • All of the files below /var/lib/mysql should have ownership mysql:mysql.
  • All of the files below /var/lib/mysql should have permissions 660.
  • All of the directories should have permissions 700 or 750.

Don't forget to reenable SELinux.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • It was permissions. Had to set the /var/log/mysql to 755 and it was tickety boo. Guess I need to learn more about the X part of "rwx"... – justacodemonkey Nov 09 '15 at 16:01