1mysql_ping(3)                 MariaDB Connector/C                mysql_ping(3)
2
3
4
5   Name
6       mysql_ping  -  checks  if  the  connection between client and server is
7       working
8
9   Synopsis
10              #include <mysql.h>
11
12              int mysql_ping(MYSQL * mysql);
13
14   Description
15       Checks whether the connection to the server is working.  If it has gone
16       down,  and global option reconnect is enabled an automatic reconnection
17       is attempted.
18
19       This function can be used by clients that remain idle for a long while,
20       to  check whether the server has closed the connection and reconnect if
21       necessary.
22
23   Parameters
24       • mysql  -  a  mysql  handle,  which  was   previously   allocated   by
25         mysql_init(3) and connected by mysql_real_connect(3).  ### Notes
26
27       • If  a  reconnect  occurred the thread_id will change.  Also resources
28         bundled to the connection (prepared statements, locks, temporary  ta‐
29         bles, ...) will be released.
30
31   Return value
32       Returns zero on success, nonzero if an error occured.
33
34   See also
35mysql_optionsv(3)
36
37mysql_kill(3)
38
39
40
41Version 3.3.1                                                    mysql_ping(3)
Impressum