Got a mysql error

Hello! When i try to connect to my localhost server i got a error:
a database error occurred while connecting to the server. (is the sql server on )

I used the mariaDB and its on… Because when i try to connect with heidisql to my database it works normaly. Only joining the server is not working

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the Cfx.re community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

Chrck the mysql connection link in your server cfg

do you host the server locally (e.g. on the host that you also host your fivem server) or is the database somewhere else? if you host it locally, are you sure the service for the database is running? depending on your os i would check the processes + the port they are listening to (in ubuntu you can do it by issuing netstat -tulp and check if there is a process for the database and if its listening on the right port). Otherwise i would check your server.cfg as you need a connection string:

set mysql_connection_string "mysql://<user>:<password>@<host>/<database_name>?charset=utf8mb4"

make sure that the user you are accessing the database has all privileges (at least to the right database)