---
name: "radsqlrelay"
section: "8"
platform: "linux"
package: "freeradius"
version: "3.2.10-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/radsqlrelay"
---

# radsqlrelay(8)

relay SQL queries to a central database server

## NAME

radsqlrelay - relay SQL queries to a central database server

## SYNOPSIS

**radsqlrelay** \[**-?**\] \[**-d** *sql\_driver*\] \[**-b** *database*\] \[**-f** *file*\] \[**-h** *host*\] \[**-u** *user*\] \[**-P** *port*\] \[**-p** *password*\] \[**-1**\] \[**-x**\] *file\_path*

## DESCRIPTION

**radsqlrelay** tails a SQL *logfile* and forwards the queries to a database server. Used to replicate accounting records to one (central) database, even if the database has extended downtime.

The SQL logfile is created by the **rlm\_sql** module with the rlm\_sql\_null driver logging to disk.. The module must be configured in the **radiusd** server before you can use **radsqlrelay**.

## OPTIONS

- \-?

  Print usage help information.

- \-d *sql\_driver*

  Driver to use: mysql, pg, oracle.

- \-b *database*

  Name of the database to use.

- \-f *file*

  Read password from file, instead of command line.

- \-h *host*

  Connect to host.

- \-u *user*

  User for login.

- \-P *port*

  Port number to use for connection.

- \-p *password*

  Password to use when connecting to server.

- \-1

  One-shot mode: push the file to database and exit.

- \-x

  Turn on debugging.

- file\_path

  The pathname of the SQL logfile to use.

## NOTES

### Oracle driver

The command "radsqlrelay -d oracle -b db.domain.tld sql-relay" reads the database description stored in $TNS\_ADMIN/tnsnames.ora:

```

db.domain.tld =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db.domain.tld)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = <DB SID>)
    )
  )
```

## AUTHOR

Nicolas Baradakis \<nicolas.baradakis@cegetel.net\>
