I've added support for the official mysql 8.0 packages and the relevant repositories.
Package names are mysql-community-server and mysql-community-client.
I know the repo setting breaks convention a bit but it is compulsory so I'm not sure how else to properly include it.
This change requires the salt pull request I created https://github.com/saltstack/salt/pull/51240 to be able to grant users.
This fixes https://github.com/saltstack-formulas/mysql-formula/issues/157
* Avoid failures on first run with a salt_user defined
Add a dependency on sls: mysql.salt-user to ensure MySQL users
(especially the salt_user) get created early enough - without that,
parts of the first run will fail (but a second run works).
mysql.server formula failed on gentoo because of hard-coded pid-file (pid_file is not detected as declared for gentoo defaults.yaml because the variable name for the pid-file is hard-coded in the init.d script installed by standard dev-db/mysql ebuild as pid-file (not pid_file)).
mysql.server formula also failed because it was missing the step. This commit adds this as an alternative mysql_initialize step for the gentoo os_family.
Some distros set the environment variable for the temp directory to
/tmp/$USER which is owned by $USER mode 700. This prevents the
mysql user from being able to access the temporary files it needs.
the config file update depends on the parent directory /etc/mysql being present, which is created as part of the mysql-server package installation. therefore, the mysqld state is split up for debian environments into the package installation and the mysqld configuration. this allows to set the pkg installation as a requirement for the config file management and to set the config file management as a requirement for the mysqld service management
In some MySQL server configurations (e.g., Amazon RDS), the root account
may not be available. Instead, one may need to use a different account
in order to perform database administration. This change replaced hard-
coded references to the root account with a Pillar lookup that defaults
to 'root'. Existing users of this formula should see no change in its
behavior.