mysql-0.15.0 has been yanked.
rust-mysql-simple 
Mysql client library implemented in rust. Feel free to open a new issues and pull requests.
Documentation
Latest crate API docs hosted here.
Installation
Please use crates.io
Also you can use git via another [dependencies.*]
section in your Cargo.toml:
[dependencies.mysql]
git = "https://github.com/blackbeam/rust-mysql-simple"
rust-mysql-simple offer support of SSL via ssl
cargo feature which is enabled by default. If you have no plans to use SSL, then you should disable that feature to not to depend on rust-openssl:
[dependencies.mysql]
mysql = "*"
default-features = false
[dependencies.mysql]
git = "https://github.com/blackbeam/rust-mysql-simple"
default-features = false
Simple example:
extern crate mysql;
use std::default::Default;
use mysql::conn::MyOpts;
use mysql::conn::pool::MyPool;
use mysql::value::from_value;
#[derive(Debug, PartialEq, Eq)]
struct Payment {
customer_id: i32,
amount: i32,
account_name: Option<String>,
}
fn main() {
let opts = MyOpts {
user: Some("some_user".into()),
pass: Some("some_password".into()),
..Default::default()
};
let pool = MyPool::new(opts).unwrap();
for mut stmt in pool.prepare("CREATE TEMPORARY TABLE tmp.payment (customer_id int not null, amount int not null, account_name text)").into_iter() {
stmt.execute(&[]).unwrap();
}
let payments = vec![
Payment { customer_id: 1, amount: 2, account_name: None },
Payment { customer_id: 3, amount: 4, account_name: Some("foo".into()) },
Payment { customer_id: 5, amount: 6, account_name: None },
Payment { customer_id: 7, amount: 8, account_name: None },
Payment { customer_id: 9, amount: 10, account_name: Some("bar".into()) },
];
for mut stmt in pool.prepare("INSERT INTO tmp.payment (customer_id, amount, account_name) VALUES (?, ?, ?)").into_iter() {
for p in payments.iter() {
stmt.execute(&[&p.customer_id, &p.amount, &p.account_name]).unwrap();
}
}
let selected_payments: Vec<Payment> = pool.prepare("SELECT customer_id, amount, account_name from tmp.payment")
.and_then(|mut stmt| { stmt.execute(&[]).map(|result| { result.map(|x| x.unwrap()).map(|row| {
Payment {
customer_id: from_value(&row[0]),
amount: from_value(&row[1]),
account_name: from_value(&row[2]),
}
}).collect() }) }).unwrap();
assert_eq!(payments, selected_payments);
println!("Yay!");
}