9 releases

Uses old Rust 2015

0.2.5 Jan 28, 2022
0.2.4 Feb 22, 2019
0.2.3 Jul 4, 2017
0.2.2 Mar 8, 2017
0.1.2 Feb 16, 2017

#1525 in Database interfaces

Download history 6189/week @ 2023-11-29 6972/week @ 2023-12-06 6962/week @ 2023-12-13 4633/week @ 2023-12-20 4800/week @ 2023-12-27 6275/week @ 2024-01-03 6729/week @ 2024-01-10 7280/week @ 2024-01-17 6782/week @ 2024-01-24 8190/week @ 2024-01-31 8594/week @ 2024-02-07 7812/week @ 2024-02-14 7933/week @ 2024-02-21 8461/week @ 2024-02-28 7692/week @ 2024-03-06 6205/week @ 2024-03-13

31,657 downloads per month
Used in 49 crates (via diesel)

MIT/Apache

190KB
4K SLoC

mysqlclient-sys

Autogenerated Rust bindings for libmysql-client (#include <mysql.h>)

Building

For this crate to build, libmysqlclient must be installed on your system (brew install mysql on macOS, apt-get install libmysqlclient-dev on Ubuntu, included with the server distribution on Windows). Additionally, either pkg-config or mysql_config must be present and able to successfully locate libmysqlclient.

The build script of the crate will attempt to find the lib path of libmysql-client using the following methods:

  • First, it will attempt to use pkg-config to locate it. All the config options, such as PKG_CONFIG_ALLOW_CROSS, PKG_CONFIG_ALL_STATIC etc., of the crate pkg-config apply.
  • MSVC ABI builds will then check for a Vcpkg installation using the vcpkg cargo build helper. Set the VCKPG_ROOT environment variable to point to your Vcpkg installation and run vcpkg install libmysql:x64-windows to install the required libraries.
  • If the library cannot be found using pkg-config, it will invoke the command mysql_config --variable=pkglibdir

The bindings will be generated against the headers present on your system at compile time. We will attempt to determine the include directory by using the output of the first command in this list to return successfully:

  • pkg-config --variable=includedir mysqlclient
  • mysql_config --variable=pkgincludedir

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies