<commit_before># Mysql module for Puppet

[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-mysql.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-mysql)

This module manages mysql on Linux (RedHat/Debian) distros. A native mysql provider implements database resource type to handle database, database user, and database permission.

Pluginsync needs to be enabled for this module to function properly.
Read more about pluginsync in our [docs](http://docs.puppetlabs.com/guides/plugins_in_modules.html#enabling-pluginsync)

## Description

This module uses the fact osfamily which is supported by Facter 1.6.1+. If you do not have facter 1.6.1 in your environment, the following manifests will provide the same functionality in site.pp (before declaring any node):

    if ! $::osfamily {
      case $::operatingsystem {
        'RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC', 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL': {
          $osfamily = 'RedHat'
        }
        'ubuntu', 'debian': {
          $osfamily = 'Debian'
        }
        'SLES', 'SLED', 'OpenSuSE', 'SuSE': {
          $osfamily = 'Suse'
        }
        'Solaris', 'Nexenta': {
          $osfamily = 'Solaris'
        }
        default: {
          $osfamily = $::operatingsystem
        }
      }
    }

This module depends on the `creates_resources` function which is introduced in Puppet 2.7. Users on puppet 2.6 can use the following module which provides this functionality:

[http://github.com/puppetlabs/puppetlabs-create_resources](http://github.com/puppetlabs/puppetlabs-create_resources)

This module is based on work by <NAME>. The following contributor have contributed patches to this module (beyond Puppet Labs):

* <NAME>
* <NAME>
* <NAME>
* <NAME>
* <NAME>
* <NAME>
* <NAME>

## Usage

### mysql
Installs the mysql-client package.

    class { 'mysql': }

### mysql::java
Installs mysql bindings for java.

    class { 'mysql::java': }
    
### mysql::php
Installs mysql bindings for php

    class { 'mysql::php': }

### mysql::python
Installs mysql bindings for python.

    class { 'mysql::python': }

### mysql::ruby
Installs mysql bindings for ruby.

    class { 'mysql::ruby': }

### mysql::server
Installs mysql-server packages, configures my.cnf and starts mysqld service:

    class { 'mysql::server':
      config_hash => { 'root_password' => '<PASSWORD>' }
    }

Database login information stored in `/root/.my.cnf`.

### mysql::db
Creates a database with a user and assign some privileges.
<commit_msg>...and add mysql::perl to README.md<commit_after># Mysql module for Puppet

[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-mysql.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-mysql)

This module manages mysql on Linux (RedHat/Debian) distros. A native mysql provider implements database resource type to handle database, database user, and database permission.

Pluginsync needs to be enabled for this module to function properly.
Read more about pluginsync in our [docs](http://docs.puppetlabs.com/guides/plugins_in_modules.html#enabling-pluginsync)

## Description

This module uses the fact osfamily which is supported by Facter 1.6.1+. If you do not have facter 1.6.1 in your environment, the following manifests will provide the same functionality in site.pp (before declaring any node):

    if ! $::osfamily {
      case $::operatingsystem {
        'RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC', 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL': {
          $osfamily = 'RedHat'
        }
        'ubuntu', 'debian': {
          $osfamily = 'Debian'
        }
        'SLES', 'SLED', 'OpenSuSE', 'SuSE': {
          $osfamily = 'Suse'
        }
        'Solaris', 'Nexenta': {
          $osfamily = 'Solaris'
        }
        default: {
          $osfamily = $::operatingsystem
        }
      }
    }

This module depends on the `creates_resources` function which is introduced in Puppet 2.7. Users on puppet 2.6 can use the following module which provides this functionality:

[http://github.com/puppetlabs/puppetlabs-create_resources](http://github.com/puppetlabs/puppetlabs-create_resources)

This module is based on work by <NAME>. The following contributor have contributed patches to this module (beyond Puppet Labs):

* <NAME>
* <NAME>
* <NAME>
* <NAME>
* <NAME>
* <NAME>
* <NAME>

## Usage

### mysql
Installs the mysql-client package.

    class { 'mysql': }

### mysql::java
Installs mysql bindings for java.

    class { 'mysql::java': }

### mysql::perl
Installs mysql bindings for perl

    class { 'mysql::perl': }

### mysql::php
Installs mysql bindings for php

    class { 'mysql::php': }

### mysql::python
Installs mysql bindings for python.

    class { 'mysql::python': }

### mysql::ruby
Installs mysql bindings for ruby.

    class { 'mysql::ruby': }

### mysql::server
Installs mysql-server packages, configures my.cnf and starts mysqld service:

    class { 'mysql::server':
      config_hash => { 'root_password' => '<PASSWORD>' }
    }

Database login information stored in `/root/.my.cnf`.

### mysql::db
Creates a database with a user and assign some privileges.

{'fraction_non_alphanumeric': 0.1272098385857033, 'fraction_numerical': 0.003843197540353574, 'mean_word_length': 3.456335616438356, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3240396', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1607, 'n_words': 504}