mysql_real_connect - Online Linux Manual PageSection : 3
Updated :
Source : Version 3.2.2
Note : MariaDB Connector/C

Namemysql_real_connect − establishes a connection to a MariaDB database server

Synopsis 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 flags);

DescriptionEstablishes a connection to a database server.

Parameter• mysql − a mysql handle, which was previously allocated by mysql_init(3) • host − can be either a host name or an IP address. Passing the NULL value or the string localhost to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol. • user − the user name. • passwd − If provided or NULL, the server will attempt to authenticate the user against those user records which have no password only. This allows one username to be used with different permissions (depending on if a password as provided or not). • db − if provided will specify the default database to be used when performing queries. • port − specifies the port number to attempt to connect to the server. • unix_socket − specifies the socket or named pipe that should be used. • flags − the flags allows various connection options to be set Flag Description CLIENT_FOUND_ROWS Return the number of matched rows instead of number of changed rows. CLIENT_NO_SCHEMA Forbids the use of database.tablename.column syntax and forces the SQL parser to generate an error. CLIENT_COMPRESS Use compression protocol CLIENT_IGNORE_SPACE Allows spaces after function names. All function names will become reserved words. CLIENT_LOCAL_FILES Allows LOAD DATA LOCAL statements CLIENT_MULTI_STATEMENTS Allows the client to send multiple statements in one command. Statements will be divided by a semicolon. CLIENT_MULTI_RESULTS Indicates that the client is able to handle multiple result sets from stored procedures or multi statements. This option will be automatically set if CLIENT_MULTI_STATEMENTS is set. CLIENT_REMEMBER_OPTIONS Rembers options passed to mysql_optionsv(3) if a connect attempt failed. If MYSQL_OPTIONS_RECONNECT option was set to true, options will be saved and used for reconnection.

Return valuereturns a connection handle (same as passed for 1st parameter) or NULL on error. On error, please check mysql_errno(3) and mysql_error(3) functions for more information.

Notes• The password doesnt need to be encrypted before executing mysql_real_connect(). This will be handled in the client server protocol. • The connection handle cant be reused for establishing a new connection. It must be closed and reinitialized before. • mysql_real_connect() must complete successfully before you can execute any other API functions beside mysql_optionsv(3).

See also• mysql_init(3) • mysql_close(3) • mariadb_reconnect(3) • mysql_error(3) • mysql_errno(3)
0
Johanes Gumabo
Data Size   :   14,390 byte
man-mysql_real_connect.3Build   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 259,095
Visitor ID   :     :  
Visitor IP   :   3.149.247.95   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.