Пример #1
0
def init(action):
    mysql = Mysql(name="mysqld", config="/etc")

    if action == "start" or action == "restart" or action == "stop":
        mysql.init(action)

    if action == "remove" or action == "install" or action == "update":
        mysql.yum("mysql mysql-server", action)
Пример #2
0
def single(character="utf8", skip_networking="0", version="5.1"):
    mysql = Mysql(name="mysqld", config="/etc")
    mysql.yum("mysql mysql-server", "install")
    mysql.single(character=character,
                 skip_networking=skip_networking,
                 version=version)
    mysql.chkconfig("on")
    mysql.init("start")
    mysql.postinstall()
Пример #3
0
def master_master(master, slave):
    mysql = Mysql(name="mysqld", config="/etc", type=None)
    mysql.get_master_info(master)
    if mysql.set_replication(slave) == 0:
        mysql.get_master_info(slave)
        mysql.set_replication(master)