-
Notifications
You must be signed in to change notification settings - Fork 1k
Mysql Troubleshooting
Start with the exact error, service status and logs. Installing a public database administration interface such as phpMyAdmin is not a diagnostic requirement and increases the attack surface.
sudo systemctl status mariadb
sudo journalctl -u mariadb --since '15 minutes ago'
mysql --versionThe service may be named mysql, run in Docker, or be hosted elsewhere. Test from the same server/container and with the same host, port, database and username used by AVideo. Do not expose the password on the command line or in a screenshot.
AVideo's database values are stored in videos/configuration.php; never publish this file. A successful administrator/root login does not prove AVideo's limited database user has access.
Common causes are a stopped database, wrong host/port, using a local socket when TCP is required, missing PHP MySQL extension, container hostname confusion or firewall rules. localhost may select a Unix socket; 127.0.0.1 selects TCP, and neither points to another Docker container.
Verify the intended connection method before changing permissions or reinstalling packages.
This means the server's connection limit was reached. Increasing max_connections without finding the cause can consume more memory and postpone another outage.
- Check current/max connections and the process list.
- Identify slow queries, abandoned workers, traffic spikes or plugins opening excessive connections.
- Check database CPU, memory and disk latency.
- Correct the cause and size connection limits together with available memory.
- Change the correct active MariaDB/MySQL configuration file, validate it and restart during a maintenance window if required.
Do not copy an arbitrary value such as 500; each connection has memory cost and the safe value depends on workload and configuration.
Confirm the exact database username, authentication host (for example localhost versus another service), password, database name and grants. Use a dedicated AVideo user with privileges only on its database. Reset the credential deliberately and update AVideo immediately; do not grant global/root access as a shortcut.
Check the first error and operation size, database uptime/restarts, network interruptions, max_allowed_packet, timeouts, disk/full conditions and slow transfers. See Error while sending QUERY packet.
When asking for help, include the database product/version, deployment layout, exact numeric error code, timestamp and sanitized log lines. Remove queries containing personal data and all credentials.