Check_Mysql_Server()
{ nc -z -w2 ${Mysql_Slave_Server} 3306 &> /dev/null
if [ $? -eq 0 ];then
echo "Connect ${Mysql_Slave_Server} OK!"
fi
}无任何输出。
#Check_Mysql_Server()
#{ nc -z -w2 ${Mysql_Slave_Server} 3306 &> /dev/null
if [ $? -eq 0 ];then
echo "Connect ${Mysql_Slave_Server} OK!"
fi
#}将Check_Mysql_Server(){}用#注释掉才能输出,是为什么?
注释掉,你看到的输出也不是真实的输出;
机器没有启动、服务没有启动、脚本函数没有调用、从服务器IP搞对没有;查看系统日志