AuthMe cannot connect to MySQL: diagnose network, login and database errors

If AuthMe disables itself at startup, find the first database error in the console. Later connection-pool errors often repeat the effect of that earlier failure. Check the MySQL log around the same timestamp.

Test from where AuthMe runs

Check the backend, host, port and database in the DataSource section of the configuration generated by your AuthMe version. In a panel container, localhost points inside that container. Run the example from the same network, replacing the sample values. The -p option prompts for the password.

mysql --protocol=TCP -h db.example.net -P 3306 -u authme -p authme

Connection refused or a timeout calls for a listener, port and firewall check. Access denied calls for checking which source host the account accepts and its database privileges. For Unknown database, confirm the exact name and that the database exists.

Once the connection works, sign in with a test account. Back up the old storage before switching backends and follow the migration procedure for your AuthMe version. A working connection does not copy accounts automatically.

Sources