Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set up MySQL using a NFS mount as datadir on CentOS.

When starting mysqld while using a mount I get this error:

chown: changing ownership of '/srv/mysql': Operation not permitted

I need to know which options I have to set to the NFS exports so MySQL can start and chown the mounted folders and files.

share|improve this question
    
NFS3 or NFS4? Further, what do your NFS server configuration / your exports file look like? –  the-wabbit Feb 5 '13 at 16:07

2 Answers 2

up vote 1 down vote accepted

If possible I would make sure there is a mysql user and group on client and server with the same UID and GID. Make sure that the directory being exported and all the contents are owned by mysql:mysql. I'm not 100% but you may want to make the mountpoint on the client mysql:mysql before mounting the NFS share.

Running MySQL with its data files on NFS is not a particularly good design though. I hope you're not trying to run multiple servers from the same data files. I was amazed to have an I.T guy ask me if he could do this just the other day.

share|improve this answer
    
Note that it is possible to run multiple MySQL server daemons off the same data directory, although it probably would be of very limited use (as there only can be a single host writing to the database files) and is discouraged. –  the-wabbit Feb 5 '13 at 16:06
    
At the momennt I got two virtualized databases. Both of them are using the NFS mount as datadir, but not at the same time since one database is the failover. I know that NFS isn't a good solution for this purpose, but I need a temporary workaround until I get dedicated database servers for the cluster. Adding the mysql user to the NFS server and let it own the directory worked. Thanks. –  moa Feb 6 '13 at 7:49

just fix directory permission from nfs server side so the script doesn't need to do any chowns.

(no operation which requires root privilege can be done on client side by default)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.