PHP show slave status hashmap, :
$db = new pdo(
"mysql:host=your_database_hostname;dbname=your_database_name",
'your_username', 'your_password');
$sql = 'show slave status';
$query = $db->query($sql);
$res = $query->fetchall();
foreach($res as $item){
print ">" . $item["Seconds_Behind_Master"];
}
0 , :
>0
I tried for an hour to create a stored procedure for this. I recommend you not to waste time.
source
share