Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


mysql2_chef_gem (9) Versions 2.0.0

Provides the mysql2_chef_gem resource

cookbook 'mysql2_chef_gem', '= 2.0.0', :supermarket
cookbook 'mysql2_chef_gem', '= 2.0.0'
knife supermarket install mysql2_chef_gem
knife supermarket download mysql2_chef_gem
Quality 43%

Mysql2 Chef Gem Installer Cookbook

Build Status Cookbook Version

mysql2_chef_gem is a library cookbook that provides a resource for installing the mysql2 gem against either mysql or mariadb depending on usage.


This cookbook is concerned with the installation of the mysql2 Rubygem into Chef's gem path. Installation into other Ruby environments, or installation of related gems such as mysql are outside the scope of this cookbook.


  • Chef 12.5+

Platform Support

The following platforms have been tested with Test Kitchen and are known to work.

|                                       | 5.0 | 5.1 | 5.5 | 5.6 | 5.7 |
| Mysql2ChefGem::Mysql / centos-5       |   X |     |     | X   | X   |
| Mysql2ChefGem::Mysql / centos-6       |     | X   | X   | X   | X   |
| Mysql2ChefGem::Mysql / centos-7       |     |     | X   | X   | X   |
| Mysql2ChefGem::Mysql / fedora         |     |     | X   | X   | X   |
| Mysql2ChefGem::Mysql / debian-7       |     |     | X   |     |     |
| Mysql2ChefGem::Mysql / ubuntu-14.04   |     |     | X   | X   |     |
| Mysql2ChefGem::Mariadb / fedora       |     |     | X   |     |     |
| Mysql2ChefGem::Mariadb / ubuntu-14.04 |     |     | X   |     |     |


Place a dependency on the mysql cookbook in your cookbook's metadata.rb

depends 'mysql2_chef_gem'

Then, in a recipe:

mysql2_chef_gem 'default' do
  action :install

Resources Overview


The mysql2_chef_gem resource the build dependencies and installation of the mysql2 rubygem into Chef's Ruby environment


mysql2_chef_gem 'default' do
  gem_version '0.4.5'
  action :install


  • gem_version - The version of the mysql Rubygem to install into the Chef environment. Defaults to '0.4.5' connector libraries
  • package_version - The version of the mysql client libraries to install and link against


  • :install - Build and install the gem into the Chef environment
  • :remove - Delete the gem from the Chef environment


Chef selects a default provider based on platform and version, but you can specify one if your platform support it.

mysql2_chef_gem 'default' do
  provider Chef::Provider::Mysql2ChefGem::Mariadb
  action :install

License & Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

build-essential >= 2.4.0
mysql >= 8.2.0
mariadb >= 0.0.0

Contingent cookbooks

abiquo Applicable Versions
alfresco-db Applicable Versions
bamboo Applicable Versions
bricks Applicable Versions
confluence Applicable Versions
crowd Applicable Versions
database Applicable Versions
drupal-cookbook Applicable Versions
dvwa Applicable Versions
foreman Applicable Versions
gitlab Applicable Versions
gotcms Applicable Versions
guardian Applicable Versions
iptables_web Applicable Versions
jira Applicable Versions
kloudspeaker Applicable Versions
mattermost Applicable Versions
mysql-multi Applicable Versions
mysql_logrotate Applicable Versions
mysql_tuning Applicable Versions
open-build-service Applicable Versions
openstack-ops-database Applicable Versions
owncloud Applicable Versions
postfixadmin Applicable Versions
singularity Applicable Versions
sonarqube-mysql Applicable Versions
spree Applicable Versions
stack_commons Applicable Versions
stash Applicable Versions
tango Applicable Versions
vicnum Applicable Versions
wordpress Applicable Versions
zabbix_lwrp Applicable Versions
zf2 Applicable Versions

mysql2_chef_gem CHANGELOG

2.0.0 (2017-03-28)

  • Converted the previously HWRP resources/providers to a custom resource. This changes the behavior of choosing to install on mysql or mariadb in a breaking way. Instead of specifying the providers you need to call the resources directly. Specifying mysql2_chef_gem will default to mysql, but using mariadb will require using the mysql2_chef_gem_mariadb resource directly.
  • Increase the minimum chef version to 12.5
  • Require mysql cookbook 8.2+ and build-essential cookbook 2.4+
  • Install the 0.4.5 gem by default
  • Expand test recipe to cover more scenarios
  • Switched testing to use Delivery local mode
  • Switched from kitchen-docker to kitchen-dokken and removed testing for CentOS 5 / Ubuntu 12.04 as these are both going EOL
  • Switched from Rubocop to cookstyle for linting
  • Removed yum/apt from the Berksfile
  • Remove test dependencies from the Gemfile and instead use ChefDK for testing

1.1.0 (2016-04-27)

  • Added a chefignore file
  • Loosen the dependency on mysql cookbook to allow for the use of the latest version
  • Added source_url and issue_url metadata
  • Added long_description metadata
  • Removed the AWS based Test Kitchen testing and replaced with with kitchen-docker in Travis
  • Updated Chefspec format to remove deprecation warnings
  • Added Oracle Linux to the metadata

1.0.2 (2015-06-29)

  • Updating metadata to depend on mysql ~> 6.0

1.0.1 (2014-12-25)

  • Moving from recipe_eval in to include_recipe LWRP

1.0.0 (2014-12-23)

  • Replacing recipes with resources
  • Mysql and MariaDB providers for linking mysql2 gem
  • Expanded platform test coverage

0.1.1 (2014-09-15)

  • Correct a typo in documentation
  • Correct a test failing with Travis CI

0.1.0 (2014-09-15)

  • Correct documentation
  • Correct rubocop offenses

0.0.3 (2014-09-12)

  • Initial release (copy of mysql-chef_gem, but for mysql2)

Collaborator Number Metric

2.0.0 passed this metric

Contributing File Metric

2.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

2.0.0 failed this metric

FC016: LWRP does not declare a default action: mysql2_chef_gem/resources/mysql2_chef_gem_mariadb.rb:1
FC016: LWRP does not declare a default action: mysql2_chef_gem/resources/mysql2_chef_gem_mysql.rb:1
Run with Foodcritic Version 8.2.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric

2.0.0 passed this metric

No Binaries Metric

2.0.0 passed this metric

Testing File Metric

2.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

2.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number