Mailinglist Archive: opensuse (1014 mails)

< Previous Next >
Re: [opensuse] setting up mysql error
On 01/31/2017 02:47 AM, george from the tribe wrote:

# Remove leading # if you want to store your database elsewhere
datadir = /home/george/FaithWiringDB/dbproj/mysql

Then I copied the mysql files from /var/lib/mysql over to
/home/george/FaithWiringDB/dbproj/mysql

at first I changed the permissions to george:users, but that didn't work so I
changed them back to root:root

Bad move all the way down the line!

Start by going back and looking at the ownership and permissions on each of:

/
/var
/var/lib/
/var/lib/mysql

Because when a processes want to open a file in /var/lib/mysql it has to
traverse all the elements in the path, not just the ownership of the file in
that directory. If at any stage along the line it can't read the directory or
searched then you get a fail.

See PATH_RESOLUTION(7). In step 2 it says

<quote>
Step 2: walk along the path
Set the current lookup directory to the starting lookup directory.
Now, for each nonfinal component of the path-name, where a component
is a substring delimited by '/' characters, this component is looked
up in the current lookup directory.

If the process does not have search permission on the current lookup
directory, an EACCES error is returned ("Permission denied").

</quote>

Now go though the same process using the ID of the service, mysql:mysql, for
each of the components of:

/home/george/FaithWiringDB/dbproj/mysql

and see where the a process with id=mysql, gid-mysql would hit a "Permission
denied".

I do NOT recommend changing all of you path to completely open permission or
making it group mysql.


All in all I don't think moving the database like this is a good idea.
I can understand you not wanting it to be on the ROOT partition.
What I don't understnd is why you have, in that case, /var on the root
partition.

Regular readers will know that I use LVM to avoid the problem of allocation
sizing at install time. I also make use of it for more meaningful partitioning.
I have the /var on a separate partition anyway. I also have /home and /srv on
separate partitions. Some of the larger things under /home/anton such as
`/Photographs also have their own partition.

I'd recommend having a separate /var partition very strongly. I'm sure that
some very heavily trafficked sites, ISPs, even have /srv and /var on their own
physical drives. In that situation the argument for have the SSD for data
rather than code is much stronger.





--
A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting frowned upon?


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >