4,579,301 th visitor since 2017.2.1 ( Today : 187 )
Programming
No. 627
Name. swindler
Subject. mysql_connect, mysql_real_connect
Main Cate. MySQL
Sub Cate. C/C++
Date. 2009-05-26 14:14
Hit. 5935 (211.36.27.8)
File.
mysql c api중에서

mysql_connect가 사라졌다.
그리고 mysql_real_connect가 새로 생겼는데,

인자가 약간 다르다.

MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd)


MYSQL *mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long client_flag)




db is the database name. If db is not NULL, the connection sets the default database to this value.
If port is not 0, the value is used as the port number for the TCP/IP connection. Note that the host parameter determines the type of the connection.
If unix_socket is not NULL, the string specifies the socket or named pipe that should be used. Note that the host parameter determines the type of the connection.
The value of client_flag is usually 0, but can be set to



여기서 port 부분에 0을 준다고 default가 들어가는건 아니라서
일단 3306으로 주긴 했는데,
이러면 포트 바뀌면 소스 다 바꿔야 되나?

여기에대한 해결책은 아직 모르겠다.


[바로가기 링크] : http://coolx.net/cboard/develop/627



swindler mysql_real_connect(&mysql,"localhost",DB_USERNAME,"", NULL, 3306, NULL, 0) 2009-06-02
Name
Password
Comment
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog