Problem changing mysql uid,gid: mysql start fails
Dear all,
first of all I'm not sure whether this is the right section where to post this question. I'm not exactly a newbie in terms of linux, but I really have no clue, so I feel like being a newbie. I need to move /var/lib/mysql directory because of space problems: the original location is a virtual machine and the new location is a directory nfs-mounted on the virtual machine (this just to explain why I want to change mysql uid/gid). Since this way the destination is a directory shared by two hosts I need first of all to make mysql uid and gid uniform in the two (the uniform uid/gid is a problem that I faced already in this kind of sharing, this is why I assume it's the firts thing to do). I did the following Code:
/etc/init.d/mysql stop If there's somebody that can give me a hint... I really have no idea! Thank you in advance |
I'll start with a question:
Why the usermod/groupmod commands? What are you trying to achieve? |
Quote:
The first is in a virtual machine (running in a certain other machine), the second is a directory in the host of the VM and mounted in the virtual machine. When I first mounted let's say /some/directory in the VM, I started to have huge problems with permissions (when reading/writing files in the mounted dir) and this was due to the fact that the users were not well mapped between guest and host. I solved the problem making uniform uid and gid in the VM (guest) and in the host (since in the beginning they were different). I assume mysql would have the same problems, this is why I imagine this is the first thing to take care of (before even try to move /var/lib/mysql). |
So ... what's the host OS, how is the drive shared,
and what is the current UID & GID on it? Realistically you should just have to make sure all relevant files & dirs (this includes config, logging, run etc) have the corret (identical) owner. |
Well,
* the host OS is a RedHat (the guest is debian) * the 'shared' directory is actually an nfs mount on the virtual-debian (I don't know if this is a satisfactory reply) * on the RedHat host "id mysql" gives uid=505 and gid=505 [..] (in the debian guest uid=104 and gid=107 [..]) Quote:
BTW: thank you very much for the attention and the help! |
I'd say that after you changed the gid and uid they don't match whats on the filesystem itself.
An Example to explain what I mean Before change of id's mysql gid: 100 mysql uid: 100 files owned by mysql: uid:100 gid:100 After change of id's mysql gid: 200 mysql uid: 200 files owned by mysql: uid:100 gid:100 So when you start mysql it comes along with 200/200 but the files are only allowed to be used by 100/100. Just because ls shows ownage by mysql before does not mean they are owned by mysql after change. (specialy because ls just converts gid/uid into names. Internaly it just goes with numbers) But before chowning the files on the new space. Make sure that the new mysql owner is allowed to write on the new space. |
Quote:
So the idea is that now I have to fish all the files of the group mysql and chsomething them? |
Quote:
Quote:
But like I sad first make sure that the new mysql user can write on the NFS share. After that you can chown the directory and all the files inside the new mysql_data_dir. |
All times are GMT -5. The time now is 06:51 AM. |