From 783ccbbcf65ac630c8473cd6052751aa896ca1e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 8 Jan 2018 11:23:40 +0100 Subject: [PATCH] Make C MySQL code work with bdSociete DB. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TD5/C/Makefile | 2 +- TD5/C/exemple_mysql_libmysqlclient.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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); -- 2.34.1