Using unsupported buffer type: 253 (parameter: 1) -> (diesel + mysql)

I installed mysql and the mysql client with brew, and then did a cargo install of diesel

cargo install diesel_cli --no-default-features --features postgres

I followed the quick start guide and got to the part to run the command:

diesel migration run

When I ran the command I got the error in the title. Has anyone ran into this issue if so how did you solve it? Thank you for any help.

A quick web search gives me this at the top of the list:
Using unsupported buffer type: 253 (parameter: 1) when trying to use the CLI #3929

Some sort of DB incompatibility. If that's not it you may want to look at other issues in the diesel github.

1 Like

Thank you so much for the help. I did the steps, but got
zsh: command not found: mysql
When I tried to run:
mysql -u root
I followed this stack overflow post's instructions. Would you happen to know how to solve the error?

I don't, sorry.

You need to install an older version of libmysqlclient to fix this error. The current versions (anything => 8.3) are not compatible with diesel 2.1 or older. Alternatively you can install diesel directly from the git repository, as the problem is already fixed there. We are hopefully able to release a fixed version in the next weeks.

1 Like

I used brew to install mysql so I thought it installed the package automatically. I saw online that you can sudo apt-get install libmysqlclient-dev, but I am currently on a mac. How would I go about installing libmysqlclient or is it better to just use a library like sqlx?

The library is named libmysqlclient. That does not mean that the package does have the same name. As I'm not a MacOS user myself I do not now how the corresponding brew package is called. Please consult the brew documentation for the best way to install that library. A quick search indicates that you likely want this package, but version 8.0.

If that's to hard to follow you can also just install a diesel version based on the latest git repository state via cargo install diesel_cli --git https://github.com/diesel-rs/diesel, which should fix your problem as well.

You can surly use sqlx, but then you lose the advantages offered by diesel (better compile time checks, better performance).

Thank you so much for the help. I installed the mysql-client 8.0 version, but I still got the issue with command not found. When I tried to install from git, I got a compatibility error:

Did not find a compatible version of libmysqlclient.

I updated libmysqlclient and I stlll got a compatibility error error. I updated mysql and I got a comparison error.

assertion `left == right` failed: Unexpected output from mysql_confi

I changed MYSQLCLIENT_LIB_DIR due to this stackoverflow post. Could that be the issue?

It's really hard to help with that kind of issues as this is dependent on your environment and we generally do not now all the details that are relevant to debug this problem. I can suggest the following solutions:

You can try to look at the CI configuration from diesel as that is guaranteed to work: diesel/.github/workflows/ci.yml at 2.1.x · diesel-rs/diesel · GitHub

Or you can try to use the new bundling support in the git version via cargo install diesel_cli --git https://github.com/diesel-rs/diesel --no-default-features -F mysql-bundled, which should just build a version of libmysqlclient as part of the build command. (Note that this will require build dependencies for libmysqlclient in your path, which include a c++ compiler and cmake).

As more more fundamental note: mysql 8.3 is branded as an experimental release from according to the offical mysql page. They recommend to use the 8.0 variants for now so I'm not even sure why brew decided to ship that version. (I would understand if they ship 8.4 which is the new stable release from mysql, but not 8.3)

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.