Skip to content

MySQL

Integrating MySQL with vScope allows you to inventory and monitor MySQL databases, providing insights into your database assets. For vScope to read from MySQL, the credentials must have specific permissions. This guide covers the required permissions to allow vScope to access and gather data from your MySQL environment.


Minimum Permissions for MySQL

To enable vScope to read MySQL data, ensure the credentials in use have read access to the following commands, tables, and procedures:

  1. SHOW DATABASES

    • Grants access to list all databases.
  2. SHOW TABLES IN db_name

    • Enables reading table lists for each specific database.
  3. information_schema.TABLES

    • Allows vScope to read table metadata.
  4. information_schema.ENGINES

    • Provides engine details for each table.
  5. mysql.user

    • Allows access to user data for authentication.
  6. SHOW VARIABLES

    • Grants access to MySQL server variables.
  7. SHOW GLOBAL STATUS

    • Provides global server status information for metrics collection.
  8. SHOW SLAVE STATUS and SHOW SLAVE HOSTS

    • Enables vScope to retrieve replication status information, valuable for monitoring MySQL clusters.

Configuring a MySQL User for vScope Access

To create a MySQL user with the required permissions, you can use the following SQL commands:

-- Replace 'vscopereader' and 'password' with your preferred username and secure password
CREATE USER 'vscopereader'@'%' IDENTIFIED BY 'password';
-- Granting necessary permissions
GRANT SELECT, SHOW VIEW ON *.* TO 'vscopereader'@'%';
-- Additional permissions for accessing server status and variables
GRANT SHOW DATABASES, SHOW VARIABLES, SHOW STATUS, REPLICATION CLIENT ON *.* TO 'vscopereader'@'%';
-- Applying changes
FLUSH PRIVILEGES;

Once the user is created with the correct permissions, configure this credential in vScope’s Discovery to allow MySQL data collection.