So, my problem is that I cannot successfully run migrations in my Rust/Diesel backend web app using MySQL as the database on Windows 11.
I have tried two different MySQL lib/DLL file versions (8.3 and 8.0) and have reinstalled the Diesel CLI. I also installed the MySQL community server side by side with my XAMPP installation with MariaDB, neither one works, but the error message is the same.
Rust version: rustc 1.75.0 (82e1608df 2023-12-21)
MySQL version: 8.0.36 (MySQL Community Server)
(EDIT: formerly 8.3.0)
The actual error message when running either diesel setup
or diesel migration run
is the following:
Using unsupported buffer type: 253 (parameter: 1)
My first migration file (up.sql
) looks like this:
CREATE TABLE categories (
id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
name TEXT NOT NULL,
);
Here's my Cargo.toml
:
[package]
name = "budget"
version = "0.1.0"
edition = "2021"
[dependencies]
chrono = { version = "0.4.24", features = ["serde"] }
rocket = { version = "0.5.0", features = ["json"] }
diesel = { version = "2.1.0", features = ["mysql", "chrono"] }
diesel_migrations = "2.1.0"
dotenvy = "0.15"
rocket_db_pools = { version = "0.1.0", features = ["diesel_mysql"] }
I'm very new to Rust and would appreciate even if someone could point me in the right direction. I don't currently know where to start looking for the underlying problem. I can provide more information as needed.
I managed to solve the problem:
MYSQLCLIENT_LIB_DIR
environment variable in advanced system settings to point to C:\Program Files\MySQL\MySQL Server 8.0\lib
diesel_cli
with the --no-default-features
and --features "mysql"
flagsAfter that, running diesel setup
and diesel migration run/redo/revert
worked.