How to use libmysqlclient on openwrt?

I'm going to develop a database client app on openwrt to access an external MySQL database server. I plan to use the libmysqlclient library. But I can't find that library in menuconfig (while similar lib for some other databases are available, such as libpq for PostgreSQL database and libsqlite3 for sqlite). In fact, I can find few library or utilities for mysql in menuconfig.

The hardware platform of my project is MT7621, and I'm using OpenWrt release 22.03.5.

I find little info about mysql client develpment on internet... So I wonder if libmysqlclient is still supported by OpenWrt? If so, how to import that lib?

Please post output of

ubus call system board
1 Like

you could try this makefile

Thank you.
I tried this makefile (adding it to feeds). But there are errors during build: some compile error when building uClibc++ and I managed to fix them; then a link error "bad_array_length.cc:(.text._ZNSt16bad_array_lengthD0Ev+0x38): undefined reference to `operator delete(void*, unsigned int)'". After google I find maybe it is because the linker of openwrt, and I can't solve it...

And, this package seems too old: the last commit is 13 years ago. I wonder if it can fit my current project now...

The output is as the following:

{
	"kernel": "5.10.176",
	"hostname": "OpenWrt",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "Trolink ASP",
	"board_name": "trolink,asp",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.5",
		"revision": "r20134-5f15225c1e",
		"target": "ramips/mt7621",
		"description": "OpenWrt 22.03.5 r20134-5f15225c1e"
	}
}

It should still be able to be created in OpenWRT 23

You have to ask your SDK provider to provide you with mysql support. It is gone from OpenWRT long ago, with logical replacement present and functional.

oh, no wonder I can't find mysqlclient lib even on openwrt.org... Maybe some other option such as luasql-mysql is the only way I can take.
Thank you anyway.

eh.. I've spent nearly a week on building that lib and till now it seems not much promising. So maybe I need to try other direction.
Still thanks for your attention.

if you run mysql or mariadb on the router it is not possible if you don't use the old version. due to the storage size on the router

Here the musl mariadb client library. If your SDK is close to OpenWRT you can install this as is.
https://downloads.openwrt.org/releases/packages-22.03/mipsel_24kc/packages/mariadb-client_10.6.15-1_mipsel_24kc.ipk