MySQL 8.0.39
Source Code Documentation
dns_srv.cc File Reference
#include <my_config.h>
#include <sql_common.h>
#include "dns_srv_data.h"
#include <netdb.h>
#include <resolv.h>

Functions

static bool get_dns_srv (Dns_srv_data &data, const char *dnsname, int &error)
 
MYSQL *STDCALL mysql_real_connect_dns_srv (MYSQL *mysql, const char *dns_srv_name, const char *user, const char *passwd, const char *db, unsigned long client_flag)
 Connect to a server using a DNS SRV name. More...
 

Function Documentation

◆ get_dns_srv()

static bool get_dns_srv ( Dns_srv_data data,
const char *  dnsname,
int &  error 
)
static

◆ mysql_real_connect_dns_srv()

MYSQL *STDCALL mysql_real_connect_dns_srv ( MYSQL mysql,
const char *  dns_srv_name,
const char *  user,
const char *  passwd,
const char *  db,
unsigned long  client_flag 
)

Connect to a server using a DNS SRV name.

See rfc2782 for what a DNS SRV is and how is one read

Parameters
mysqla MySQL handle to use
dns_srv_namethe name of the DNS SRV resource to query. ANSI
userthe user name to pass to mysql_real_connect
passwdthe password to pass to mysql_real_connect
dbthe database to pass to mysql_real_connect
client_flagthe client flag to pass to mysql_real_connect
Return values
NULLan error has occurred
non-NULLthe connected MySQL handle to use

If the OS doesn't support it the function returns OS error -1.

SRV FORMAT: _service._proto.name. TTL class SRV priority weight port target.

Example: _sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.

See also
mysql_real_connect