当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Replication_Slave_control函数代码示例

本文整理汇总了PHP中PMA_Replication_Slave_control函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Replication_Slave_control函数的具体用法?PHP PMA_Replication_Slave_control怎么用?PHP PMA_Replication_Slave_control使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_Replication_Slave_control函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_Replication_Slave_changeMaster

/**
 * Changes master for replication slave
 *
 * @param string $user     replication user on master
 * @param string $password password for the user
 * @param string $host     master's hostname or IP
 * @param int    $port     port, where mysql is running
 * @param array  $pos      position of mysql replication,
 *                         array should contain fields File and Position
 * @param bool   $stop     shall we stop slave?
 * @param bool   $start    shall we start slave?
 * @param mixed  $link     mysql link
 *
 * @return string output of CHANGE MASTER mysql command
 */
function PMA_Replication_Slave_changeMaster($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null)
{
    if ($stop) {
        PMA_Replication_Slave_control("STOP", null, $link);
    }
    $out = $GLOBALS['dbi']->tryQuery('CHANGE MASTER TO ' . 'MASTER_HOST=\'' . $host . '\',' . 'MASTER_PORT=' . $port * 1 . ',' . 'MASTER_USER=\'' . $user . '\',' . 'MASTER_PASSWORD=\'' . $password . '\',' . 'MASTER_LOG_FILE=\'' . $pos["File"] . '\',' . 'MASTER_LOG_POS=' . $pos["Position"] . ';', $link);
    if ($start) {
        PMA_Replication_Slave_control("START", null, $link);
    }
    return $out;
}
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:26,代码来源:replication.inc.php

示例2: PMA_handleRequestForSlaveSkipError

/**
 * handle control requests for Slave Skip Error
 *
 * @return boolean
 */
function PMA_handleRequestForSlaveSkipError()
{
    $count = 1;
    if (isset($_REQUEST['sr_skip_errors_count'])) {
        $count = $_REQUEST['sr_skip_errors_count'] * 1;
    }
    $qStop = PMA_Replication_Slave_control("STOP");
    $qSkip = $GLOBALS['dbi']->tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";");
    $qStart = PMA_Replication_Slave_control("START");
    $result = $qStop !== false && $qStop !== -1 && $qSkip !== false && $qSkip !== -1 && $qStart !== false && $qStart !== -1;
    return $result;
}
开发者ID:bajajahsaas,项目名称:phpmyadmin,代码行数:17,代码来源:replication_gui.lib.php

示例3: PMA_handleRequestForSlaveSkipError

/**
 * handle control requests for Slave Skip Error
 *
 * @return NULL
 */
function PMA_handleRequestForSlaveSkipError()
{
    $count = 1;
    if (isset($_REQUEST['sr_skip_errors_count'])) {
        $count = $_REQUEST['sr_skip_errors_count'] * 1;
    }
    PMA_Replication_Slave_control("STOP");
    $GLOBALS['dbi']->tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";");
    PMA_Replication_Slave_control("START");
}
开发者ID:roccivic,项目名称:phpmyadmin,代码行数:15,代码来源:replication_gui.lib.php


注:本文中的PMA_Replication_Slave_control函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。