> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectdiscovery.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Mysql

# Namespace: mysql

## Table of contents

### Classes

* [MySQLClient](/templates/protocols/javascript/modules/mysql.MySQLClient)

### Interfaces

* [MySQLInfo](/templates/protocols/javascript/modules/mysql.MySQLInfo)
* [MySQLOptions](/templates/protocols/javascript/modules/mysql.MySQLOptions)
* [SQLResult](/templates/protocols/javascript/modules/mysql.SQLResult)
* [ServiceMySQL](/templates/protocols/javascript/modules/mysql.ServiceMySQL)

### Functions

* [BuildDSN](/templates/protocols/javascript/modules/mysql#builddsn)

## Functions

### BuildDSN

▸ **BuildDSN**(`opts`): `string` | `null`

BuildDSN builds a MySQL data source name (DSN) from the given options.

#### Parameters

| Name   | Type                                                                         |
| :----- | :--------------------------------------------------------------------------- |
| `opts` | [`MySQLOptions`](/templates/protocols/javascript/modules/mysql.MySQLOptions) |

#### Returns

`string` | `null`

**`Example`**

```javascript theme={null}
const mysql = require('nuclei/mysql');
const options = new mysql.MySQLOptions();
options.Host = 'acme.com';
options.Port = 3306;
const dsn = mysql.BuildDSN(options);
```

#### Defined in

mysql.ts:14
