fabtools.require.mysql

MySQL

This module provides high-level tools for installing a MySQL server and creating MySQL users and databases.

See also

fabtools.mysql

fabtools.require.mysql.server(version=None, password=None)[source]

Require a MySQL server to be installed and running.

Example:

from fabtools import require

require.mysql.server(password='s3cr3t')
fabtools.require.mysql.user(name, password, **kwargs)[source]

Require a MySQL user.

Extra arguments will be passed to fabtools.mysql.create_user().

Example:

from fabric.api import settings
from fabtools import require

with settings(mysql_user='root', mysql_password='s3cr3t'):
    require.mysql.user('dbuser', 'somerandomstring')
fabtools.require.mysql.database(name, **kwargs)[source]

Require a MySQL database.

Extra arguments will be passed to fabtools.mysql.create_database().

Example:

from fabric.api import settings
from fabtools import require

with settings(mysql_user='root', mysql_password='s3cr3t'):
    require.mysql.database('myapp', owner='dbuser')