I have gone through and done this for all the salt states that have a MySQL state call. If this is an acceptable path forward I am happy to submit a pull request with the changes.
Additional context
I am unsure why this is happening. Looking at /etc/my.cnf.d/server shows that the socket is set correctly in there.
Your setup
CentOS 8 VM with Salt Stack installed.
Formula commit hash / release tag
I'm using the master branch.
Versions reports (master & minion)
Pillar / config used
I'm using the following Salt Formulas:
Bug details
Describe the bug
Whenever I try run a command that uses a Salt MySQL command I get the following error:
This doesn't happen for States that run through the
cmd
function. (E.g. themysql_root_password
state usescmd.run
)Expected behaviour
Expected it to connect and not fail.
Attempts to fix the bug
I noticed that by adding the socket into the Salt formulas this fixed the issue.
Adding the socket in a variable: https://github.com/lmeerwood/mysql-formula/blob/master/mysql/database.sls#L10
Passing the socket to the state: https://github.com/lmeerwood/mysql-formula/blob/master/mysql/database.sls#L43-L45
I have gone through and done this for all the salt states that have a MySQL state call. If this is an acceptable path forward I am happy to submit a pull request with the changes.
Additional context
I am unsure why this is happening. Looking at
/etc/my.cnf.d/server
shows that the socket is set correctly in there.