SMB share and Mysql service database directory

Solway

Dabbler
Joined
Aug 14, 2019
Messages
25
Hi all

Im having a issue with a Mysql service starting when the datadir pointed to the freenas SMB share. Cant for the life of me figure out whats wrong.
It seems to be a freenas perimission thing i think, not mysql issue.?


Currently i have a Mysql database running on a windows 10 pc. The datadir has been redirected to a old SMBv1 nas box.
The Mysql uses the login of the user to the NAS box. all works fines.

BUT i need to get rid of the old NAS box and now redirect the datadir FREENAS box with SMB share.

Redirecting this "datadir" back to a local windows 10 folder. the mysql works fine!

However when directing this to the FREENAS share, the service can not start (think its permissions issue)

The FREENAS users get authorized via a Windows Server 2019 active directory in a domain.

for example domain user is usersql@abc.local
usersql@abc.local is part of domain admins group

windows 10 can login with this "usersql@abc.local" on the share and has full permissions. Same will all other users.


Changing the mysql service to run as "usersql@abc.local" and pointing the datadir to this...
the service will not start....???



The FREENAS dataset has perssions set as:
ACL=windows
User=ABC/Administrator
Group=ABC\domain admins

usersql@abc.local is part of domain admins!


SMB service has the following aux parameters:
nfs4:mode = simple
ea support = no
store dos attributes = no
map archive = no
map hidden = no
map readonly = no
map system = no



does anyone know whats wrong?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
You might find that you need to do some custom attributes on the share to get that to work with the right kind of locking for the database to get the right kind of file access.

As a general rule, databases and SMB shares are not good partners.
 

Solway

Dabbler
Joined
Aug 14, 2019
Messages
25
You might find that you need to do some custom attributes on the share to get that to work with the right kind of locking for the database to get the right kind of file access.

As a general rule, databases and SMB shares are not good partners.
completely new to this.

the mysql worked on the old NAS (not freenas) without issues.
just dont know why it cant work on this with AD auth?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Can you manually browse to the location of the db as that user?
 

Solway

Dabbler
Joined
Aug 14, 2019
Messages
25
Can you manually browse to the location of the db as that user?
yes all AD auth is working, all have full permissions

unless i test freenas with its built in user?

or should i change user in freenas perimssions to the domain user and not admin. thinking the domain group thing might not tbe working right?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
So if you're connected to a windows computer and logged in as the account usersql@abc.com, you can browse or connect to the SMB share and you can see the mysql files?
 

Solway

Dabbler
Joined
Aug 14, 2019
Messages
25
So if you're connected to a windows computer and logged in as the account usersql@abc.com, you can browse or connect to the SMB share and you can see the mysql files?
no, i have to copy the entire datadir there first and then change directory in mysql ini file for it to link. but the mysql service doesnt work once directory is changed.

all users and PCs can view/edit the smb share. just the mysql service seems to have trouble for some reason.
 

Solway

Dabbler
Joined
Aug 14, 2019
Messages
25
anyone else got ideas?

this mysql is for the free "hmailserver" if anyone wants to be so kind and try it.

i have tried AD auth
i have tried with freenas auth only
i hvae tried just allowing everyone/guest

its strange everything else, except mysql can use the share.
 

Solway

Dabbler
Joined
Aug 14, 2019
Messages
25
fixed. if anyone comes across this.... try adding double \\ to the UNC path in the my.ini config

so
\\FREENAS\datashare\folder
becomes
\\\\FREENAS\\datashare\\folder

wtf mysql!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Escaping literal characters is a thing... not sure why you didn't see it being a problem before, but perhaps the linux host you were using had a different opinion on how the string was being processed.
Perhaps putting the string in some kind of quotation marks (single or double) may also have reached the same result.
 
Top