Fill in your password
Replace $YOUR_PASSWORD
with password of your choice.
What you would like to collect from your MySQL?
Collect logs and metrics from your MySQL instance using Vector and Prometheus mysqld exporter.
Create a dedicated MySQL user for Vector to securely scrape metrics:
mysql -u root -p
CREATE USER 'better_stack_metrics'@'localhost' IDENTIFIED BY '$YOUR_PASSWORD';
GRANT PROCESS, REPLICATION CLIENT, SHOW DATABASES ON *.* TO 'better_stack_metrics'@'localhost';
GRANT SELECT ON performance_schema.* TO 'better_stack_metrics'@'localhost';
GRANT SELECT ON mysql.user TO 'better_stack_metrics'@'localhost';
Replace $YOUR_PASSWORD
with password of your choice.
FLUSH PRIVILEGES;
exit;
Create /etc/mysqld_exporter.cnf
config file using MySQL user password you've just set:
[client]
user=better_stack_metrics
password=$YOUR_PASSWORD
Install latest mysqld exporter:
curl -sSL https://telemetry.betterstack.com/install/mysqld_exporter | sudo -E bash
Start the MySQL exporter:
systemctl start mysqld_exporter
launchctl start com.prometheus.mysqld_exporter
Select your platform:
Install and configure Vector on Ubuntu or Debian:
curl -sSL https://telemetry.betterstack.com/setup-vector/mysql_with_metrics/$SOURCE_TOKEN \
-o /tmp/setup-vector.sh && \
bash /tmp/setup-vector.sh
Curious about what the script does?
The script will ask for confirmation before making any changes.
You should see your logs in Better Stack → Live tail.
Collect logs from your MySQL database using Vector.
Select your platform:
Install and configure Vector on Ubuntu or Debian:
curl -sSL https://telemetry.betterstack.com/setup-vector/mysql/$SOURCE_TOKEN \
-o /tmp/setup-vector.sh && \
bash /tmp/setup-vector.sh
Curious about what the script does?
The script will ask for confirmation before making any changes.
You should see your logs in Better Stack → Live tail.
Please let us know at hello@betterstack.com.
We're happy to help! 🙏
Find step-by-step instructions in our dedicated Vector guide.