# Setup and usage

## Set up your Database connection (if not WebGL build)

{% hint style="info" %}
If you want to use this in production - your database need to be opened to the world. Otherwise - you will not connect to database. For local connection check your firewall and open database port. Default MySql port is 3306. If you want to use WebGL build - skip this setup and read "Action Use WebGl"
{% endhint %}

Make **Global or Local Variable** that will save your connection strin&#x67;**.** \
Add Trigger "**On start**" and add action "**Mysql Set Config**".

![](https://1038266918-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOWoZRvpfXHIVNe7SxM%2F-MSJeo57V8CRePMXrvwv%2F-MSJz_QtaPkDvYF7yvo9%2F1.png?alt=media\&token=b0646d90-35c8-428d-a546-b3a3b2bb8c08)

After this use [**Mysql Connect Action**](https://9476764.gitbook.io/rezus13/mysql-for-game-creator/usage/mysql-actions/action-mysql-connect) to make connection to your database!&#x20;

#### **This two actions must execute with onStart trigger. Otherwise you will have errors with using other Mysql Actions**

If you have some troubles with this - watch this tutorial video

{% embed url="<https://youtu.be/1Eb2WEwZJls?list=TLPQMTYxMjIwMjBi8n0cd_InCg>" %}

If everything is good, this action will make a connection string which you will use in other **Mysql Actions**
