REM Windows XP
netsh firewall set portopening protocol = TCP port = 1433 name = MsSQLPort mode = ENABLE scope = SUBNET profile = CURRENT
netsh firewall set portopening protocol = TCP port = 3306 name = MySQLPort mode = ENABLE scope = SUBNET profile = CURRENT
REM Windows 7
netsh advfirewall firewall add rule name = MsSQLPort dir = in protocol = tcp action = allow localport = 1433 remoteip = localsubnet profile = DOMAIN
netsh advfirewall firewall add rule name = MySQLPort dir = in protocol = tcp action = allow localport = 3306 remoteip = localsubnet profile = DOMAIN
@pause