You are here : Cmysql/mysql.hmysql_init

mysql_init() - mysql/mysql.h

 Allocates or initializes a MYSQL object
        suitable for
        mysql_real_connect(). If
        mysql is a NULL pointer,
        the function allocates, initializes, and returns a new object.
        Otherwise, the object is initialized and the address of the
        object is returned. If
        mysql_init() allocates a new
        object, it is freed when
        mysql_close() is called to close
        the connection.MYSQLmysql_real_connect()mysql_real_connect()mysqlNULLmysql_init()mysql_init()mysql_close()mysql_close()In a nonmulti-threaded environment,
        mysql_init() invokes
        mysql_library_init()
        automatically as necessary. However,
        mysql_library_init() is not
        thread-safe in a multi-threaded environment, and thus neither is
        mysql_init(). Before calling
        mysql_init(), either call
        mysql_library_init() prior to
        spawning any threads, or use a mutex to protect the
        mysql_library_init() call. This
        should be done prior to any other client library call.mysql_init()mysql_init()mysql_library_init()mysql_library_init()mysql_library_init()mysql_library_init()mysql_init()mysql_init()mysql_init()mysql_init()mysql_library_init()mysql_library_init()mysql_library_init()mysql_library_init()


Syntax

MYSQL *mysql_init(MYSQL *mysql)


Example

 


Output / Return Value

 An initialized MYSQL* handle.
        NULL if there was insufficient memory to
        allocate a new object.MYSQL*NULL


Limitations


Alternatives / See Also


Reference