Red Hat Bugzilla – Bug 131536
Incorrect root ownership of /var/lib/mysql/mysql after install
Last modified: 2013-07-02 23:01:48 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2)
Description of problem:
safe_mysqld can't initialize as user mysql and access the DB when
files are owned by root.
Error logged in /var/log/mysqld.log: '/usr/libexec/mysqld: Can't find
file: './mysql/host.frm' (errno: 13)'
NOTE: I have switched user to root to run safe_mysqld, but the script
correctly initializes as user 'mysql'.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install mysql-3.23.58-9 and mysql-server-3.23.58-9.
2. Run safe_mysqld as root.
Actual Results: mysql attempts to start, immediately fails and ends.
Expected Results: mysql should initialize.
This has been incorrect for quite awhile. The MySQL team has actually
included instructions for changing the permissions by hand in the post
install instructions for RH / Fedora.
After further research, during the rpm install, mysql_install_db is
being run as root, so the files in /var/lib/mysql/ are incorrectly
assigned root ownership / permissions. Switching user to mysql for
this step would solve the problem.
I can't see anything wrong here. The rpm itself does not create
anything under /var/lib/mysql/ at all --- and it does create that
directory as owned by mysql. That stuff will be auto-created when you
first do "service mysqld start", but the init file does a chown to
ensure that the files are correctly owned. I ran through it just to
check and got a correctly owned fileset and a correctly started
My guess is that you made a mistake in your manual invocation of
safe_mysqld, but it's hard to tell without seeing the exact command
line. In any case, that's not the preferred way to do things.
I'm going to mark this WORKSFORME, but feel free to reopen the bug if
you can give a more specific explanation of why you feel the RPM is