Bug 131536 - Incorrect root ownership of /var/lib/mysql/mysql after install
Summary: Incorrect root ownership of /var/lib/mysql/mysql after install
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-02 00:51 UTC by chris crowell
Modified: 2013-07-03 03:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-05 21:11:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description chris crowell 2004-09-02 00:51:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2)
Gecko/20040803

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):
mysql-3.23.58-9

How reproducible:
Always

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 10:15:28 UTC
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 21:11:14 UTC
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
server.

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
wrong.


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