mysql常用函数原型讲解和用法.pdfVIP

  • 2
  • 0
  • 约1.05万字
  • 约 8页
  • 2023-07-31 发布于上海
  • 举报
mysql常⽤函数原型讲解和⽤法 MYSQL API⽂档 23.8.7.36 mysql_init() MYSQL *mysql_init(MYSQL *mysql) Description: Allocates or initializes a MYSQL object suitable for mysql_real_connect(). If mysql is a NULL pointer, the function allocates, initializes, and returns a In a nonmulti-threaded environment, mysql_init() invokes mysql_library_init() automaticallyas necessary. However, mysql_library_init() is not thread-safe Return Values An initialized MYSQL* handler. NULL if there was insufficient memory to allocate a new object. Errors In case of insufficient memory, NULL is returned. 23.8.7.52 mysql_real_connect() Description mysql_real_connect() attempts to establish a connection to a MySQL database engine running on host. mysql_real_connect() must complete successfully For host, specify a value of NULL or the empty string (). For user, specify a value of NULL or the empty string. For passwd, specify a value of NULL. (For the password, a value of the empty string in the mysql_real_connect() call cannot be overridden in an option For db, specify a value of NULL or the empty string. For port, specify a value of 0. For unix_socket, specify a value of NULL. If no value is found in an option file for a parameter, its default value is used as indicated in the descriptions given earlier in this section. Return Values A MYSQL* connection handler if the connection was successful, NULL if the connection was unsuccessful. For a successful connection, the return value Errors CR_CONN_HOST_ERROR Failed to connect to the MySQL server. CR_CONNECTION_ERROR Failed to connect to the local MySQL server. CR_IPSOCK_ERROR Failed to create an IP socket. CR_OUT_OF_MEMORY Out of memory.

文档评论(0)

1亿VIP精品文档

相关文档