-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Common problems, what they mean, and how to fix them. Turn on debug logging first — it usually tells you exactly what's wrong:
mysql_debug(true); // prints [omp-MySQL] diagnostics to the console(In the mysql-admin demo: /mysql debug on via RCON.)
Check mysql_errno / mysql_error and the [omp-MySQL] debug line. Most common causes:
| Symptom in the log | Cause | Fix |
|---|---|---|
Can't connect / Connection refused
|
MySQL isn't running, or wrong host/port | Start MySQL; verify host/port (default 3306). Test: mysql -u user -p -h 127.0.0.1
|
Access denied for user |
Wrong username/password, or the user isn't allowed from your host | Re-check credentials; the user's host ('user'@'host') must match where you connect from |
Unknown database |
The database doesn't exist |
CREATE DATABASE mydb; or fix the name |
Unknown server host |
Bad hostname / DNS | Use an IP like 127.0.0.1; check spelling |
TLS/SSL error |
See the TLS section below | — |
The server doesn't support TLS, so omp-MySQL refused (it's fail-closed). You're almost certainly on MySQL 5.6 or older (no default TLS), or TLS is disabled on the server. Use MySQL 5.7+ (8.4 LTS recommended). See MySQL versions.
You used SSL_MODE_VERIFY_CA/VERIFY_IDENTITY but didn't give a CA the server's
cert chains to. Either:
- supply the CA:
mysql_config_set(cfg, SSL_CA, "scriptfiles/ca.pem"), or - for local/dev, use
SSL_MODE_REQUIRED(encrypt without verifying the cert).
How to get the CA is in Configuration.
VERIFY_IDENTITY checks that the certificate's name matches the host you connect to.
MySQL's auto-generated cert uses a generic name. Fix by connecting to a name in the
cert, regenerating the server cert with your host/IP in its SAN, or dropping to
VERIFY_CA. See Security.
The callback function doesn't exist where the component looked. Check:
- It's spelled exactly the same in
mysql_execute(..., "OnSomething")andpublic OnSomething(). - It's
forward-ed andpublic. - It exists in a loaded script (gamemode or a loaded filterscript).
- Did the query fail? Add an
OnQueryErrorhandler, or checkmysql_debug(true)output. - Are you reading the result inside the callback? The result set is only active there.
- The query returned no rows — check
mysql_rs_row_count(rows)first. - Wrong column name — it must match the
SELECTexactly (use an alias:SELECT COUNT(*) AS c). - You're reading after the callback ended — read while it's still running.
- Parameter indices are 1-based: the first
?is index 1, not 0. - Bind a value for every
?beforemysql_stmt_execute. - See Prepared statements.
- Make sure
libssl-3.dllandlibcrypto-3.dllare next toomp-server.exe(they ship in the Windows release zip). The DLL needs them at runtime. - You need the Microsoft Visual C++ runtime (most systems have it).
-
omp-mysql.sogoes incomponents/. It's built for glibc 2.31 (matches the open.mp Linux server) — use the released binary rather than building on a very new distro.
- Confirm the component loaded: the console prints
omp-mySQL v1.0.0 loadedon start. - Confirm
#include <omp-mysql>compiles (the.incis inqawno/include/).
Nothing — passwords are only hashed and compared, never put into SQL. Player input
in queries is handled with prepared statements or %e escaping. See Security.
No. Session state is wiped on every connect; login always requires the password. (The mysql-admin demo enforces this.)
Nobody automatically. In the mysql-admin demo, everyone registers as a Player; the
first admin is promoted via RCON (/setlevel). See mysql-admin demo.
- Turn on
mysql_debug(true)and read the[omp-MySQL]lines. - Check
mysql_errno/mysql_errorafter a failed call. - Open an issue: https://github.com/Mac-Andreas/omp-MySQL/issues — include the debug log, your MySQL version, and the smallest code that reproduces it.
Understand
Use
- Installing MySQL
- Docker Compose
- Getting started
- Configuration
- SQL crash course
- Designing your tables
- Storing game data
- Dates & times
- First queries
- Async patterns
- Reading results
- Prepared statements
- Passwords & hashing
- Transactions
- Models (active-record)
- Tutorial: login system
- mysql-admin demo
Deeper
Reference