Registry / database / libmysql

libmysql

JSON →
library8.0.40vcpkgunverified

A MySQL client library for C development, providing the MySQL client API.

vcpkg install libmysql
INSTALL
IMPORT
SIG · LIBMYSQL
L
libmysql
databasecppv8.0.40
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mysql/mysql.h
#include <mysql/mysql.h>

Connect to a MySQL database

#include <mysql/mysql.h> #include <iostream> int main() { MYSQL *conn = mysql_init(NULL); if (conn == NULL) { std::cerr << "mysql_init failed" << std::endl; return 1; } if (mysql_real_connect(conn, "localhost", "user", "password", "database", 0, NULL, 0) == NULL) { std::cerr << mysql_error(conn) << std::endl; mysql_close(conn); return 1; } std::cout << "Connected to MySQL" << std::endl; mysql_close(conn); return 0; }
Debug
Known issues
gotchaRequires linking with pthreads on some platforms.
fix
Add -lpthread to linker flags or use CMake's Threads::Threads.
affects: *
Upgrade
Version history
8.0.40latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources

No resource links recorded.

libmysql — pip install libmysql · libregistry