{% extends "base.html" %} {% block content %}

Manage Hosts

Configure MySQL servers and organize them into groups

Security Recommendation

Always use a read-only MySQL user with minimal privileges for MASC. This tool only needs SELECT access to system tables and views — never use your admin credentials.

MySQL Commands
-- Create a dedicated read-only user for MASC
-- Run these commands as MySQL root/admin user

-- 1. Create the user (change 'masc_password' to a secure password)
CREATE USER 'masc_reader'@'%' IDENTIFIED BY 'masc_password';

-- 2. Grant minimal required privileges
-- Process list access (for SHOW PROCESSLIST)
GRANT PROCESS ON *.* TO 'masc_reader'@'%';

-- Replication client (for SHOW MASTER/REPLICA STATUS)
GRANT REPLICATION CLIENT ON *.* TO 'masc_reader'@'%';

-- Read access to performance_schema (for hot tables, optional)
GRANT SELECT ON performance_schema.* TO 'masc_reader'@'%';

-- Read access to information_schema (automatic, but explicit)
GRANT SELECT ON information_schema.* TO 'masc_reader'@'%';

-- 3. Apply the changes
FLUSH PRIVILEGES;

-- Verify grants
SHOW GRANTS FOR 'masc_reader'@'%';

Note: Replace '%' with the specific IP/hostname of your MASC server for better security.

{% if error %}
{{ error }}
{% endif %} {% if groups %}
{% for group in groups %} {% set group_hosts = grouped_hosts.get(group.id, []) %}

{{ group.name }}

{% if group.description %}

{{ group.description }}

{% endif %}
{{ group_hosts|length }} host{% if group_hosts|length != 1 %}s{% endif %}
{% if group_hosts %} {% for host in group_hosts %} {{ caller() if caller is defined else '' }} {% endfor %}
Host Connection Status Last Test Actions
{{ host.label }}
{{ host.id }}
{{ host.host }}:{{ host.port }}
User: {{ host.user }}
{% if host.enabled %} Active {% else %} Disabled {% endif %} {% if host.last_test_at %}
{% if host.last_test_success %} OK {% else %} Failed {% endif %}
{% else %} Never {% endif %}
{% else %}
No hosts in this group.
{% endif %}
{% endfor %}
{% endif %} {% if ungrouped_hosts %}

Ungrouped Hosts

Hosts not assigned to any group

{{ ungrouped_hosts|length }} host{% if ungrouped_hosts|length != 1 %}s{% endif %}
{% for host in ungrouped_hosts %} {% endfor %}
Host Connection Status Last Test Actions
{{ host.label }}
{{ host.id }}
{{ host.host }}:{{ host.port }}
User: {{ host.user }}
{% if host.enabled %} Active {% else %} Disabled {% endif %} {% if host.last_test_at %}
{% if host.last_test_success %} OK {% else %} Failed {% endif %}
{% else %} Never {% endif %}
{% endif %} {% if not hosts %}

No Hosts Configured

Add your MySQL servers to start collecting diagnostics. Your existing hosts.yaml will be automatically imported.

{% endif %}

New DB Group

{% for color in ['ocean', 'emerald', 'violet', 'amber', 'crimson'] %} {% endfor %}

Edit Group

{% for color in ['ocean', 'emerald', 'violet', 'amber', 'crimson'] %} {% endfor %}

Add New Host

Security Warning: Using admin credentials is not recommended. Create a read-only user instead.

{% if groups %}
{% endif %}

Edit Host

ID:

Security Warning: Using admin credentials is not recommended. Create a read-only user instead.

{% if groups %}
{% endif %}
{% endblock %}