# create\_mysql\_connection

{% tabs %}
{% tab title="Variant 1" %}
```
char create_mysql_connection(char connectionName, char databaseName, char userName, char userPassword);
```

#### Return Value <a href="#return-value" id="return-value"></a>

Nothing if connection has been made successfully. Otherwise, error text as string.

#### Parameters <a href="#parameters" id="parameters"></a>

`char connectionName` - unique name to identify this connection in web session

`char databaseName` - Mysql database name

`char userName` - database login user name&#x20;

`char userPassword` - database user password

#### Example <a href="#example" id="example"></a>

```
void connection_not_found(char connectionName) {
        char connResult;
        connResult = create_mysql_connection('default', 'mysql', 'root', 'password');
}

void cb_mysql.logon2mysql() {
        char connResult;
        connResult = create_mysql_connection('default', 'mysql', 'root', 'password');
        if (connResult is null) then
                show_page('mysql.frmx');
        else
                message('Error occured: ' || connResult);
        end if;
}

```
{% endtab %}
{% endtabs %}
