3 unstable releases

new 0.1.1 May 31, 2024
0.1.0 May 17, 2024
0.0.1 May 17, 2024

#2472 in Database interfaces

Download history 530/week @ 2024-05-16 285/week @ 2024-05-23

815 downloads per month
Used in 3 crates (2 directly)

GPL-2.0 license

32MB
548K SLoC

C++ 457K SLoC // 0.2% comments C 81K SLoC // 0.2% comments Puppet 4K SLoC // 0.0% comments M4 2K SLoC // 0.4% comments Shell 1K SLoC // 0.2% comments Bitbake 786 SLoC // 0.0% comments Automake 522 SLoC // 0.1% comments AWK 427 SLoC // 0.1% comments GNU Style Assembly 371 SLoC // 0.2% comments LLVM 268 SLoC Visual Studio Project 181 SLoC Batch 44 SLoC Rust 39 SLoC // 0.1% comments Visual Studio Solution 25 SLoC VBScript 4 SLoC // 0.8% comments

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 VCPKG_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 by using the steps above the build script will check the MYSQLCLIENT_LIB_DIR and MYSQLCLIENT_VERSION environment variables
  • If the library cannot be found using pkg-config, it will invoke the command mysql_config --variable=pkglibdir

The crate will try to use pregenerated bindings for a variety of libmysqlclient versions and supported operating systems.

License

Licensed under either of

at your option.

The mysqlclient-src crate is licensed under GPL-2.0 to match the license of the packed mysql source code.

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

~31MB
~761K SLoC