# mysql\_options

## Syntax

```c
int mysql_options(MYSQL * mysql,
                  enum mysql_option,
                  const void * arg);
```

* `mysql` - a mysql handle, which was previously allocated by [mysql\_init()](mysql_init) or [mysql\_real\_connect()](mysql_real_connect).
* `mysql_option` - the option you want to set. See description below.
* `arg` - the value for the option.

## Description

Used to set extra connect options and affect behavior for a connection. This function may be called multiple times to set several options. mysql\_options() should be called after [mysql\_init()](mysql_init) and before [mysql\_real\_connect()](mysql_real_connect).

Returns zero on success, non zero if an error occurred (invalid option or value).

{% hint style="warning" %}
This function is deprecated as of MariaDB Connector/C 3.0 and will be removed in future releases. It's preferable to use [mysql\_optionsv](mysql_optionsv).
{% endhint %}

### Options

See [mysql\_optionsv](mysql_optionsv).

## See also

* [mysql\_init()](mysql_init)
* [mysql\_optionsv](mysql_optionsv)
* [mysql\_real\_connect()](mysql_real_connect)

{% @marketo/form formId="4316" %}
