From: Jérôme Benoit Date: Mon, 8 Jan 2018 10:23:40 +0000 (+0100) Subject: Make C MySQL code work with bdSociete DB. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=783ccbbcf65ac630c8473cd6052751aa896ca1e2;p=TD_BDD.git Make C MySQL code work with bdSociete DB. Signed-off-by: Jérôme Benoit --- diff --git a/TD5/C/Makefile b/TD5/C/Makefile index eb1c686..7f5ffe9 100644 --- a/TD5/C/Makefile +++ b/TD5/C/Makefile @@ -11,7 +11,7 @@ # # Automatic dependencies code from: # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr -BINARY_NAME=infovols +BINARY_NAME=liste_usines BUILD_TYPE=debug #BUILD_TYPE=release LDLIBS=-lmysqlclient diff --git a/TD5/C/exemple_mysql_libmysqlclient.c b/TD5/C/exemple_mysql_libmysqlclient.c index 9f26acc..9dcc636 100644 --- a/TD5/C/exemple_mysql_libmysqlclient.c +++ b/TD5/C/exemple_mysql_libmysqlclient.c @@ -4,7 +4,7 @@ //il faut : libmysqlclient-dev -//compilation : +//compilation : // gcc testsqlc.c -o testsqlc -I/usr/include/mysql -lmysqlclient -L/usr/lib64/mysql //execution : @@ -17,10 +17,10 @@ int main(void) MYSQL_ROW row; MYSQL_RES *result; - char *server = ""; - char *user = ""; + char *server = "localhost"; + char *user = "fraggle"; char *password = ""; - char *database = ""; + char *database = "bdSociete"; conn = mysql_init(NULL);