This sections contains some examples on how to connect to a MySQL database, get information from it and to read data from it. The original examples contained a mysql.cfg file from which the examples reads the credentials of a mysql server.
The file has been removed since I've experienced problems with my own heap and teh loss of data after mysql_server_init.

The installation of libmysqlcient is required (sudo apt install libmysqlclient). All files are build with following makefile.


BIN=mysqldatabase mysqluuid mysqlclientinfo mysqlserverinfo
NASM=/usr/bin/nasm
NASMOPTS=-felf64 -Fdwarf
LDOPS=-melf_x86_64 -g --dynamic-linker /lib64/ld-linux-x86-64.so.2
LIBS=-lc -lmysqlclient

.PHONY: all clean

all: $(BIN)

clean:
	rm -rf $(BIN)

%: %.asm
	$(NASM) $(NASMOPTS) -o $@.o $<
	$(LD) $(LDOPS) -o $@ $@.o $(LIBS)
	rm -f $@.o