Curious about what the script does?
- Installs Vector using official package.
- Configures Vector for your Better Stack source.
- Enables and restarts Vector.
The script will ask for confirmation before making any changes.
What you would like to collect from your MySQL?
Collect logs & metrics from your MySQL instance using Vector and Prometheus mysqld exporter.
curl https://logs.betterstack.com/scripts/mysqld_exporter | bash
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_here';
GRANT PROCESS, REPLICATION CLIENT, SHOW DATABASES ON *.* TO 'better_stack_metrics'@'localhost';
GRANT SELECT ON performance_schema.* TO 'better_stack_metrics'@'localhost';
If you're running MySQL 8.0 or later and want to collect user statistics, you'll also need to add access to user statistics:
GRANT SELECT ON mysql.user TO 'better_stack_metrics'@'localhost';
Flush privileges & exist MySQL:
FLUSH PRIVILEGES;
exit;
[client]
user=better_stack_metrics
password=your_password_here
mysqld_exporter --config.my-cnf=".my.cnf"
Select your platform:
Install and configure Vector on Ubuntu or Debian:
curl -sSL https://logs.betterstack.dev/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.
Select your platform:
Install and configure Vector on Ubuntu or Debian:
curl -sSL https://logs.betterstack.dev/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.
Please let us know at [email protected].
We're happy to help! 🙏
Prefer setting up Vector manually?
Find step-by-step instructions in our dedicated Vector guide.