Bug 131536 - Incorrect root ownership of /var/lib/mysql/mysql after install
Incorrect root ownership of /var/lib/mysql/mysql after install
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2004-09-01 20:51 EDT by chris crowell
Modified: 2013-07-02 23:01 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-05 17:11:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description chris crowell 2004-09-01 20:51:00 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):

How reproducible:

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.

Additional info:

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.
Comment 1 chris crowell 2004-09-02 06:15:28 EDT
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.
Comment 2 Tom Lane 2004-10-05 17:11:14 EDT
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

Note You need to log in before you can comment on or make changes to this bug.