SelectStar

Prerequisites

Before attempting to monitor your MySQL databases with SelectStar, ensure it meets the following criteria and perform the setup steps:

Supported MySQL versions
Supported storage engines
  • 5.6
  • 5.7
  • InnoDB
  • MyISAM

Connection Information

The following information is required by SelectStar in order to monitor to your MySQL databases:

Field
API Field
Description

Database

database

Name of the database in your instance to monitor

Host

host

Hostname or IP address of the system on which your database is running

Port

port

Port on which your database is listening [default: 3306]

Enable SSL

ssl_enable

Use SSL connections to your database [default: false]

Credentials

Field
API Field
Description

Username

username

MySQL JDBC user

Password

password

User's password

1. Configuring MySQL

Performance Schema

Ensure the performance schema is enabled, by checking the 'my.cnf' file under the [mysqld] section. If your database is running in Amazon RDS you will need to change the parameter group instead. See these steps instead.

performance_schema=ON

Potential Restart

If the performance schema was not turned on, the MySQL database will require a restart before the changes can take affect.

Performance Schema on Amazon RDS

To track queries, you'll need to edit the following policy settings:

log_bin_trust_function_creators

1

performance_schema

1

Potential Restart

If the performance schema was not turned on, the MySQL database will require a restart before the changes can take affect.

mysql-sys schema

Some metrics SelectStar gathers are only available through the mysql-sys schema. This schema comes standard in MySQL 5.7 but previous versions of MySQL (5.6) including Amazon Aurora MySQL and MariaDB require it to be installed manually.

To monitor these additional metrics you will need to follow the steps located in the mysql-sys github repository.

Note If you need to install this schema on RDS you can use the following generate command to build your user script.

./generate_sql_file.sh -v 56 -b -u CURRENT_USER

These steps are based on the mysql-sys repository.

2. Creating a Monitoring User

In order to access and return certain metrics from your database, specific privileges must be granted to the designated MySQL user:

CREATE USER 'selectstaruser'@'%' IDENTIFIED BY 'tmppassword';
GRANT SELECT,EXECUTE ON sys.* TO 'selectstaruser'@'%';
GRANT REPLICATION CLIENT, REPLICATION SLAVE, PROCESS, SHOW DATABASES, SELECT ON *.* TO 'selectstaruser'@'%';
FLUSH PRIVILEGES;

Errors when creating your user

If you encounter errors when creating the monitoring user, make sure to run the user script as a script. You can also run each line separately

Troubleshooting: I don't see my full query text

Query Length

By default, MySQL allocates 1024 bytes to query normalization. In practice, this means that MySQL often truncates queries during the normalization process, and does not differentiate between queries that differ after the truncation point.

To increase the memory allocated to query normalization, run the following command, replacing BYTES with the number of bytes you wish to allocate to query normalization.

Warning

Increasing the max_digest_length setting can affect the performance of your database. Please make sure you are comfortable with the tradeoff. See the official MySQL documentation for more information.

SET @max_digest_length = BYTES