FiveM
Connect the MySQL database
Set your connection string and fix the errors it throws when it is wrong.
3 min read
Your database credentials are in the Databases tab of the panel. FiveM reads them from a single line in server.cfg.
set mysql_connection_string "mysql://user:password@host:3306/database?charset=utf8mb4"- "Access denied for user" — the username or password does not match what the panel shows.
- "Unknown database" — the database name in the string is wrong or was never created.
- "ECONNREFUSED" — the host or port is wrong. Use the host from the panel, not localhost.
- Special characters in the password have to be URL-encoded, or the string is cut short at that character.