Inserting script variables into database

I have a script working out ink percentages

#!/bin/bash
currentcyan=$'iso.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER: 990'
currentmagenta=$'iso.3.6.1.2.1.43.11.1.1.9.1.2 = INTEGER: 972'
currentyellow=$'iso.3.6.1.2.1.43.11.1.1.9.1.3 = INTEGER: 972'
currentblack=$'iso.3.6.1.2.1.43.11.1.1.9.1.4 = INTEGER: 250'
maxcyan=$'iso.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER: 2800'
maxmagenta=$'iso.3.6.1.2.1.43.11.1.1.8.1.2 = INTEGER: 1800'
maxyellow=$'iso.3.6.1.2.1.43.11.1.1.8.1.3 = INTEGER: 1800'
maxblack=$'iso.3.6.1.2.1.43.11.1.1.8.1.4 = INTEGER: 2500'
cyanperc=$(( ${currentcyan##* }*100/${maxcyan##* } ))
magentaperc=$(( ${currentmagenta##* }*100/${maxmagenta##* } ))
yellowperc=$(( ${currentyellow##* }*100/${maxyellow##* } ))
blackperc=$(( ${currentblack##* }*100/${maxblack##* } ))
echo $cyanperc
echo $magentaperc
echo $yellowperc
echo $blackperc

Instead of echoing the values I want to insert them into a MySql database on a server. Maybe curl?

Any help appreciated.

Raspberry Pi 3 running Ubuntu Mate, GNU, version 4.3.46(1)

If you write them to a delimited file, you can use the mysql tools to load it to a table. You can set the delimiter to anything that you won't otherwise find in the data. Common choices are pipe/vertical bar | , comma , or the at sign @ however the default for MySQL load files is a tab character.

If you get the data in the correct columns and tab separated, then have a look at the syntax page to see how to load it. It can be a bit confusing, but you haven't told us anything about your database to know where you want to load it.

Have a go and if/when you get stuck, show us what you have tried and I'm sure someone will be able to help out. Please describe the target table too and let us know the database name you are connecting to, if it is the default local instance etc.

Kind regards,
Robin