First, we have to add dependencies to establish a connection to MySQL. We use all the same dependencies as in the previous example, but have replaced postgres with the mysql crate, and r2d2_postgres with the r2d2_mysql crate:
mysql = "14.1"
r2d2_mysql = "9.0"
We still need the csv, rayon, r2d2, and serde family crates.
You also have to declare other types to use them in the code, as follows:
use mysql::{Conn, Error, Opts, OptsBuilder};
use r2d2_mysql::MysqlConnectionManager;