# info > DBD::Proxy

---
type: CommandReference
command: DBD::Proxy
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference

- `DBI->connect("dbi:Proxy:hostname=alpha;port=3334;dsn=DBI:ODBC:mydb", "joe", "hello")` — connect to a remote ODBC database via a proxy server running on alpha:3334

## Name

DBD::Proxy - A proxy driver for the DBI

## Synopsis

perl
use DBI;
$dbh = DBI->connect("dbi:Proxy:hostname=$host;port=$port;dsn=$db",
                     $user, $passwd);
## Options

DSN string format: `DBI:Proxy:key1=val1; ... ;keyN=valN;dsn=valDSN`

- `hostname` — hostname of the proxy server (required)
- `port` — port of the proxy server (required)
- `dsn` — complete DSN for the remote driver, must be last (e.g., `DBI:ODBC:mydb`)
- `cipher` / `key` — enable encryption during login/authorisation phase; `cipher` is the class name, `key` is a hex key
- `usercipher` / `userkey` — private encryption for subsequent phases after authorisation
- `debug` — turn on debugging mode
- `stderr` — redirect RPC::PlClient logging to stderr (default under Windows)
- `logfile` — redirect logging to a file (e.g., `/dev/null`)
- `RowCacheSize` — number of rows to fetch in one round-trip (default 20)
- `proxy_no_finish` — if set to a true value, suppress `finish()` calls to reduce network traffic (useful for CGI)
- `proxy_quote` — set to `"local"` to use local DBI quote method instead of remote (faster but may be wrong)

## Examples

Connect to a remote ODBC database:

perl
$dsn = "DBI:Proxy:hostname=alpha;port=3334;dsn=DBI:ODBC:mydb";
$dbh = DBI->connect($dsn, "joe", "hello");
Workaround for complex handle attributes (e.g., `DBD::CSV`):

perl
$tables = $dbh->{"csv_tables"};
$tables->{"passwd"} = { "sep_char" => ":", "eol" => "\n" };
$dbh->{"csv_tables"} = $tables;
## Known Issues

- **Unproxied method calls**: If a method isn't proxied, declare a stub in the appropriate package (e.g., `sub DBD::Proxy::db::selectall_arrayref;`). This enables proxying. Many methods are not explicitly proxied; the DBI's default methods execute on the client, and some may call proxied sub-methods, reducing performance.
- **Complex handle attributes**: Assigning to nested hash keys (e.g., `$dbh->{"csv_tables"}->{"passwd"} = {...}`) modifies a local copy, not the server's hash. Workaround: fetch the hash, modify locally, then store it back.

## Security Warning

`RPC::PlClient` uses `Storable` for serialization, which is not secure. Use the proxy driver only in a trusted environment.

## See Also

- [DBI](http://localhost/phpMan.php/perldoc/DBI/markdown)
- [RPC::PlClient](http://localhost/phpMan.php/perldoc/RPC%3A%3APlClient/markdown)
- [Storable](http://localhost/phpMan.php/perldoc/Storable/markdown)
- [DBD::Gofer](http://localhost/phpMan.php/perldoc/DBD%3A%3AGofer/markdown) — alternative with different trade-offs
- [DBD::ProxyServer](http://localhost/phpMan.php/perldoc/DBI%3A%3AProxyServer/markdown) — server configuration details