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

RSS

mysql (182) Versions 4.0.20

Provides mysql_service, mysql_config, and mysql_client resources

Policyfile
Berkshelf
Knife
cookbook 'mysql', '= 4.0.20', :supermarket
cookbook 'mysql', '= 4.0.20'
knife supermarket install mysql
knife supermarket download mysql
README
Dependencies
Quality -%

mysql Cookbook

Build Status

Installs and configures MySQL client or server.

Requirements

Chef 0.10.10+.

Platform

  • Debian, Ubuntu
  • CentOS, Red Hat, Fedora
  • Mac OS X (Using homebrew)

Tested on:

  • Ubuntu 10.04, 12.04
  • CentOS 5.9, 6.5

See TESTING.md for information about running tests in Opscode's Test Kitchen.

Cookbooks

Requires Opscode's openssl cookbook for secure password generation. See Attributes and Usage for more information.

The RubyGem installation in the mysql::ruby recipe requires a C compiler and Ruby development headers to be installed in order to build the mysql gem.

Requires homebrew cookbook on Mac OS X.

Resources and Providers

The LWRP that used to ship as part of this cookbook has been refactored into the
database cookbook. Please see the README for details on updated usage.

Attributes

See the attributes/server.rb or attributes/client.rb for default values. Several attributes have values that vary based on the node's platform and version.

  • node['mysql']['port'] - Listen port for MySQLd
  • node['mysql']['data_dir'] - Location for mysql data directory. WARNING This will only on initial converge. It will not move data around if you change it.

  • node['mysql']['client']['packages'] - An array of package names
    that should be installed on "client" systems. This can be modified,
    e.g., to specify packages for Percona.

  • node['mysql']['server']['packages'] - An array of package names
    that should be installed on "server" systems. This can be modified,
    e.g., to specify packages for Percona.

  • node['mysql']['auto-increment-increment'] -
    auto-increment-increment value in my.cnf

  • node['mysql']['auto-increment-offset] - auto-increment-offset value in my.cnf

  • node['mysql']['server']['basedir'] - Base directory where MySQL is installed

  • node['mysql']['bind_address'] - Listen address for MySQLd

  • node['mysql']['ec2_path'] - location of mysql data_dir on EC2 nodes

  • node['mysql']['grants_path'] - Path where the grants.sql should be written

  • node['mysql']['mysqladmin_bin'] - Path to the mysqladmin binary

  • node['mysql']['server']['old_passwords'] - Sets the old_passwords value in my.cnf.

  • node['mysql']['server']['pid_file'] - Path to the mysqld.pid file

  • node['mysql']['server']['reload_action'] - Action to take when mysql conf
    files are modified. Also allows "reload" and "none".

  • node['mysql']['server']['root_group'] - The default group of the "root" user

  • node['mysql']['server']['service_name'] - The name of the mysqld service

  • node['mysql']['server']['socket'] - Path to the mysqld.sock file

  • mysql['root_network_acl'] - Set define the network the root user will be able to login from, default is nil

Performance and other "tunable" attributes are under the node['mysql']['tunable'] attribute, corresponding to the same-named parameter in my.cnf, and the default values are used. See attributes/server.rb.

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

  • node['mysql']['remove_anonymous_users'] - Remove anonymous users

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

  • node['mysql']['allow_remote_root'] - If true Sets root access from '%'. If false deletes any non-localhost root users.

By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. This will also drop any user privileges to the test database and any DB named test_% .

  • node['mysql']['remove_test_database'] - Delete the test database and access to it.

The following attributes are randomly generated passwords handled in the mysql::server recipe, using the OpenSSL cookbook's secure_password helper method. These are set using the set_unless node attribute method, which allows them to be easily overridden e.g.
in a role.

  • node['mysql']['server_root_password'] - Set the server's root password
  • node['mysql']['server_repl_password'] - Set the replication user 'repl' password
  • node['mysql']['server_debian_password'] - Set the debian-sys-maint user password

Windows Specific

The following attributes are specific to Windows platforms.

  • node['mysql']['client']['version'] - The version of MySQL connector to install.
  • node['mysql']['client']['arch'] - Force 32 bit to work with the mysql gem
  • node['mysql']['client']['package_file'] - The MSI file for the mysql connector.
  • node['mysql']['client']['url'] - URL to download the mysql connector.
  • node['mysql']['client']['packages'] - Similar to other platforms, this is the name of the client package.
  • node['mysql']['client']['basedir'] - Base installation location
  • node['mysql']['client']['lib_dir'] - Libraries under the base location
  • node['mysql']['client']['bin_dir'] - binary directory under base location
  • node['mysql']['client']['ruby_dir'] - location where the Ruby binaries will be

Security Options

Further information is already available at Symantec and Deutsche Telekom (German)

Usage

On client nodes, use the client (or default) recipe:

{ "run_list": ["recipe[mysql::client]"] }

This will install the MySQL client libraries and development headers on the system.

On nodes which may use the database cookbook's mysql resources, also use the ruby recipe. This installs the mysql RubyGem in the Ruby environment Chef is using via chef_gem.

{ "run_list": ["recipe[mysql::client]", "recipe[mysql::ruby]"] }

If you need to install the mysql Ruby library as a package for your system, override the client packages attribute in your node or role. For example, on an Ubuntu system:

{
  "mysql": {
    "client": {
      "packages": ["mysql-client", "libmysqlclient-dev","ruby-mysql"]
    }
  }
}

This creates a resource object for the package and does the installation before other recipes are parsed. You'll need to have the C compiler and such (ie, build-essential on Ubuntu) before running the recipes, but we already do that when installing Chef :-).

On server nodes, use the server recipe:

{ "run_list": ["recipe[mysql::server]"] }

On Debian and Ubuntu, this will preseed the mysql-server package with the randomly generated root password in the recipe file. On other platforms, it simply installs the required packages. It will also create an SQL file, /etc/mysql/grants.sql, that will be used to set up grants for the root, repl and debian-sys-maint users.

The recipe will perform a node.save unless it is run under chef-solo after the password attributes are used to ensure that in the event of a failed run, the saved attributes would be used.

On EC2 nodes, use the server_ec2 recipe and the mysql data dir will be set up in the ephmeral storage.

{ "run_list": ["recipe[mysql::server_ec2]"] }

When the ec2_path doesn't exist we look for a mounted filesystem (eg, EBS) and move the data_dir there.

The client recipe is already included by server and 'default' recipes.

For more infromation on the compile vs execution phase of a Chef run:

Chef Solo Note

These node attributes are stored on the Chef server when using chef-client. Because chef-solo does not connect to a server or save the node object at all, to have the same passwords persist across chef-solo runs, you must specify them in the json_attribs file used. For example:

{
  "mysql": {
    "server_root_password": "iloverandompasswordsbutthiswilldo",
    "server_repl_password": "iloverandompasswordsbutthiswilldo",
    "server_debian_password": "iloverandompasswordsbutthiswilldo"
  },
  "run_list":["recipe[mysql::server]"]
}

License & Authors

Copyright:: 2009-2013 Opscode, Inc

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

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

openssl ~> 1.1
build-essential ~> 1.4

Contingent cookbooks

aegir Applicable Versions
aegir2 Applicable Versions
aegir3 Applicable Versions
agilefant Applicable Versions
alfresco Applicable Versions
alfresco-db Applicable Versions
automysqlbackup Applicable Versions
bacula Applicable Versions
bacula-backup Applicable Versions
bamboo Applicable Versions
boilerplate Applicable Versions
boxbilling Applicable Versions
bricks Applicable Versions
cacti Applicable Versions
cakephp Applicable Versions
cg_mysql Applicable Versions
chef_jira Applicable Versions
cloudstack Applicable Versions
cloudstack_wrapper Applicable Versions
config-driven-helper Applicable Versions
configure_and_deploy_ssc Applicable Versions
confluence Applicable Versions
coopr Applicable Versions
crowd Applicable Versions
cyclesafe_chef Applicable Versions
database Applicable Versions
database_restore Applicable Versions
databox Applicable Versions
druid-example Applicable Versions
drupal Applicable Versions
drupal-cookbook Applicable Versions
drupalbaseplus Applicable Versions
dvwa Applicable Versions
elefant Applicable Versions
eulipion-cleanspeak Applicable Versions
fanfare Applicable Versions
ff_sync Applicable Versions
flyway Applicable Versions
fog Applicable Versions
foreman Applicable Versions
frog Applicable Versions
frontaccounting Applicable Versions
gallery Applicable Versions
gerrit Applicable Versions
gitlab Applicable Versions
gitlab-server Applicable Versions
gitlabhq Applicable Versions
gitorious Applicable Versions
gotcms Applicable Versions
guardian Applicable Versions
hollandbackup Applicable Versions
huginn Applicable Versions
iptables_web Applicable Versions
ish Applicable Versions
ish_mediawiki Applicable Versions
jahia Applicable Versions
jira Applicable Versions
laravel Applicable Versions
lxmpbox Applicable Versions
madhucookbook Applicable Versions
magento Applicable Versions
mattermost Applicable Versions
mediawiki Applicable Versions
mineos Applicable Versions
mroonga Applicable Versions
mw_mysql Applicable Versions
myface Applicable Versions
mysql-chef_gem Applicable Versions
mysql-hardening Applicable Versions
mysql-multi Applicable Versions
mysql-replication Applicable Versions
mysql-test-schema Applicable Versions
mysql2_chef_gem Applicable Versions
mysql_charset Applicable Versions
mysql_chef_gem Applicable Versions
mysql_logrotate Applicable Versions
mysql_role Applicable Versions
mysql_tuning Applicable Versions
mythtv Applicable Versions
myusa Applicable Versions
nodestack Applicable Versions
ohmage Applicable Versions
open-build-service Applicable Versions
opencart Applicable Versions
openstack-common Applicable Versions
openstack-mistral Applicable Versions
openstack-ops-database Applicable Versions
opsview Applicable Versions
orchestrator Applicable Versions
owncloud Applicable Versions
pagekit Applicable Versions
pdns Applicable Versions
petals Applicable Versions
phabricator Applicable Versions
php Applicable Versions
phpbb Applicable Versions
phpstack Applicable Versions
pinba Applicable Versions
piwik Applicable Versions
postfixadmin Applicable Versions
prestashop Applicable Versions
pvpgn Applicable Versions
pythonstack Applicable Versions
q2a Applicable Versions
rackmonkey Applicable Versions
radiant Applicable Versions
redmine Applicable Versions
redmine2 Applicable Versions
roundcube Applicable Versions
ruby-env-cookbook Applicable Versions
rubycas Applicable Versions
seafile Applicable Versions
shaybtest Applicable Versions
singularity Applicable Versions
sphinx Applicable Versions
spree Applicable Versions
sptoolkit Applicable Versions
stack_commons Applicable Versions
stackstorm Applicable Versions
stash Applicable Versions
sugar_crm Applicable Versions
sugarcrm Applicable Versions
sugarcrm-ce Applicable Versions
sugarcrm_ce Applicable Versions
symfony Applicable Versions
tango Applicable Versions
teampass Applicable Versions
testswarm Applicable Versions
tungsten Applicable Versions
vicnum Applicable Versions
wordpress Applicable Versions
wordpress-windows Applicable Versions
zabbix Applicable Versions
zabbix2 Applicable Versions
zabbix_lwrp Applicable Versions
zarafa Applicable Versions
zenoss Applicable Versions
zf2 Applicable Versions

No quality metric results found