Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 29 Sep 2001 22:23:36 +0200 From: Scr34m Subject: Re[2]: Mysql In-reply-to: To: Michael Hoffman Cc: cygwin AT cygwin DOT com Reply-to: Scr34m Message-id: <5422002147.20010929222336@frontember.hu> Organization: frontember.hu MIME-version: 1.0 X-Mailer: The Bat! (v1.53d) Personal Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Priority: 3 (Normal) References: Hi Michael, >> I moved from linux /usr/inclode/mysql files into my cygwin include >> dir. MH> Don't do that. MH> You need libraries for MySQL. Build them from the MySQL source, using: MH> ./configure --without-server MH> Of course, you will have to get the native Windows server if you want to MH> run the server locally. MH> A caveat: MySQL for Windows uses named pipes to talk to local clients, MH> whereas the MySQL library you compile will want to use UNIX sockets. I MH> found the easiest way to get them talking was to always use a host of MH> 127.0.0.1, forcing INET sockets. Under perl DBI, if you use "localhost," MH> somebody decides to be smart and use UNIX sockets anyway. MH> An additional caveat: There is probably a better way to do the above. MH> Stipe? I run mysql under win200 its work i didn't want run under cygwin i want only write a program wich read tables from MySQL. !!!!here is my probe to connect to mysql server!!!! #include #include #include #include #include #define LEN_SERV 60 #define LEN_LOGIN 16 #define LEN_TABLE 64 char *SVname, *Cuser, *Cpass, *Dname, *TBname, *DefDom; int Port_num=0; char *Socket_file=NULL; #define LEN_BUFFER LEN_TABLE+20 int mysql_keepopen=1; int mysql_acct_keepopen; int mysql_use=1; int check_host=0; int check_quota=0; int myAUTH_ignore_validity=0; MYSQL real_mysql, *mysql = NULL; MYSQL_RES *result; int main(){ return(0); } /**********************************************/ /**********************************************/ /**********************************************/ int Mysql_Reconnect(){ int i ; if (!(mysql=mysql_connect(&real_mysql, "127.0.0.1", "root", ""))) { mysql = NULL; } else { mysql = &real_mysql; } i++; sleep(3); if (mysql != NULL) { mysql_select_db(mysql, Dname); } } /*******************************/ void My_Mysql_Close(int keepopen_flag) { if(keepopen_flag == 0) { /* Close the connection after each record */ if (mysql != NULL) { mysql_close(mysql); } mysql = NULL; } } --- Bye Scr34m | www.inertia.hu | www.frontember.hu | eurohack.at.hu | -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/