Passes[install_options](https://docs.puppetlabs.com/references/latest/type.html#package-attribute-install_options) array to managed package resources. You must pass the appropriate options for the specified package manager.
*`mysqlbackup`:ImplementsbackupswithMySQLEnterpriseBackupfromOracle.Backuptype:Physical.Tousethistypeofbackup,you'llneedthe`meb`package,whichisavailableinRPMandTARformatsfromOracle.ForUbuntu,youcanuse[meb-deb](https://github.com/dveeden/meb-deb) to create a package from an official tarball.
**Note**:Ifyou'reusingthisclassonanon-network-connectedsystem,youmustdownloadthemysqltuner.plscriptandhaveithostedsomewhereaccessiblevia`http(s)://`, `puppet://`, `ftp://`, or a fully qualified file path.
Passes`install_options`arraytomanagedpackageresources.Youmustpassthe[appropriateoptions](https://docs.puppetlabs.com/references/latest/type.html#package-attribute-install_options) for the package manager(s).
It is possible to specify privileges down to the column level:
```puppet
mysql_grant { 'root@localhost/mysql.user':
ensure => 'present',
privileges => ['SELECT (Host, User)'],
table => 'mysql.user',
user => 'root@localhost',
}
```
To revoke GRANT privilege specify ['NONE'].
##### `ensure`
Whether the resource is present.
Valid values are 'present', 'absent'.
Defaults to 'present'.
##### `name`
Name to describe the grant. Must in a 'user/table' format.
##### `privileges`
Privileges to grant the user.
##### `table`
The table to which privileges are applied.
##### `user`
User to whom privileges are granted.
##### `options`
MySQL options to grant. Optional.
#### mysql_plugin
`mysql_plugin` can be used to load plugins into the MySQL Server.
```puppet
mysql_plugin { 'auth_socket':
ensure => 'present',
soname => 'auth_socket.so',
}
```
##### `ensure`
Whether the resource is present.
Valid values are 'present', 'absent'.
Defaults to 'present'.
##### `name`
The name of the MySQL plugin to manage.
##### `soname`
The library file name.
#### `mysql_datadir`
Initializes the MySQL data directory with version specific code. Pre MySQL 5.7.6 it uses mysql_install_db. After MySQL 5.7.6 it uses mysqld --initialize-insecure.
Insecure initialization is needed, as mysqld version 5.7 introduced 'secure by default' mode. This means MySQL generates a random password and writes it to STDOUT. This means puppet can never access the database server afterwards, as no credentials are available.
This type is an internal type and should not be called directly.
### Facts
#### `mysql_version`
Determines the MySQL version by parsing the output from `mysql --version`
#### `mysql_server_id`
Generates a unique id, based on the node's MAC address, which can be used as `server_id`. This fact will *always* return `0` on nodes that have only loopback interfaces. Because those nodes aren't connected to the outside world, this shouldn't cause any conflicts.
### Tasks
The MySQL module has an example task that allows a user to execute arbitary SQL against a database. Please refer to to the [PE documentation](https://puppet.com/docs/pe/2017.3/orchestrator/running_tasks.html) or [Bolt documentation](https://puppet.com/docs/bolt/latest/bolt.html) on how to execute a task.
## Limitations
This module has been tested on:
* RedHat Enterprise Linux 5, 6, 7
* Debian 6, 7, 8
* CentOS 5, 6, 7
* Ubuntu 10.04, 12.04, 14.04, 16.04
* Scientific Linux 5, 6
* SLES 11
Testing on other platforms has been minimal and cannot be guaranteed.
**Note:** The mysqlbackup.sh does not work and is not supported on MySQL 5.7 and greater.
Debian 9 compatibility has not been fully verified.
## Development
Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
Check out our the complete [module contribution guide](https://docs.puppetlabs.com/forge/contributing.html).
### Authors
This module is based on work by David Schmitt. The following contributors have contributed to this module (beyond Puppet Labs):