# MySQL\_Open

## `MySQL_Open` (FB)

FUNCTION\_BLOCK MySQL\_Open

**Kurze Beschreibung:**

> Dieser Funktionsbaustein öffnet die MySQL-Verbindung.

**Detaillierte Beschreibung:**\
Der Öffnungsvorgang startet mit einer steigenden Flanke von `xStart`. Die Variable `xStart` wird am Ende des Vorgangs zurückgesetzt.\
Tritt während des Öffnungsvorgangs ein Fehler auf, wird ein FEHLER-Code sowie der aktuelle Ausführungszustand angezeigt, was bei der Identifizierung des Problems hilft.

InOut:

| Scope  | Name               | Type                    | Initial | Comment                                                                        |
| ------ | ------------------ | ----------------------- | ------- | ------------------------------------------------------------------------------ |
| Input  | `sHost`            | `STRING`                |         | MySQL-Server hostname or IP-Address                                            |
| Input  | `uiPort`           | `UINT`                  | 3306    | MySQL-Server port (Default: 3306)                                              |
| Input  | `sDatabase`        | `STRING`                |         | MySQL database name                                                            |
| Input  | `sUsername`        | `STRING`                |         | MySQL database user                                                            |
| Input  | `sPassword`        | `STRING`                |         | MySQL user password                                                            |
| Inout  | `xStart`           | `BOOL`                  |         | Start execution on a rising edge                                               |
| Inout  | `MySQL_Connection` | MySQL\_ConnectionString |         | <p>MySQL connection string which holds the server and login<br>information</p> |
| Output | `xConnected`       | `BOOL`                  |         | TRUE when connected                                                            |
| Output | `eError`           | ERROR                   |         | Error type                                                                     |
| Output | `sExeute_State`    | `STRING(200)`           |         | Current execute state                                                          |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/mysql-library/funktionsbausteine/mysql_open.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
