This can help avoid confusion when running multiple instances on the same server, or when moving or reinstalling the client.
The chartio_setup wizard will walk you through setting up a readonly user and connecting to Chartio. Then, you'll be given you a link to visit your dashboard and see some charts being automatically generated.
Alternatively, you can download and install the Chartio Connection Client source yourself:
curl https://chartio.com/static/src/chartio-latest.tar.gz -o chartio-latest.tar.gz
tar xvzf chartio-latest.tar.gz
sudo python setup.py install
If your MySQL database is hosted on Amazon RDS, Heroku or another hosting service that does not allow shell access to the database instances, you won't be able to use the Connection Client and will instead need to connect directly. If your database is on Amazon RDS, please visit the RDS setup documentation to first enable Chartio to your security group before following these steps.
In your Project Settings, select Data Source from the left column, then select Add a New Data Source. You'll be redirected to the list of connection options, where you can choose MySQL to connect your MySQL database.
You'll be redirected to a form to enter your database connection information.
To connect to MySQL, Chartio needs the following information:
host - the host name or IP address of the server your database is hosted on
database name - the name of the database you're connecting
user - the name of a preferably read-only user to your database
password - the password for the read-only user
port - the port that the database is listening to (default: 3306)
Creating a Read-only User
Chartio highly recommends creating a read-only user for connecting to your database. If you fill out the form (without submitting) with a desired user and password you'd like to create, the form page automatically generates the MySQL GRANT statement needed to create the read-only access user. The statement is in the following format.
GRANT SELECT, SHOW VIEW
TO $user@`rackspace1.chart.io` IDENTIFIED BY '$password';
Where $database_name, $user, and $password are the described form values above. Copy this command and paste it into a MySQL shell to create the user. This will grant the user read-only access to ALL tables in your database. If you would like to restrict access to only certain tables in your database, please see the documentation on MySQL GRANT syntax.
With a read-only user created, you can now submit the Chartio connection form and your connection to Chartio will be complete!
If you have issues connecting with Chartio, the exact MySQL or connection errors should be displayed for you as form errors when submitting. If you are unclear on what the error messages mean or how to fix them, do not hesitate to email us at firstname.lastname@example.org.
If you have already established a database connection but something is going wrong, please read our documentation on database connection debugging.
MySQL SSL Connection
MySQL users can also generate a certificate and configure their database to connect to Chartio with SSL encryption. This method is not recommended over the Connection Client but can help with security in the event that your database must use the direct connection method. Instructions on creating a certificate and SSL connection can be found in the MySQL SSL connection documentation.