I am working on a Debian 12 system running on an AWS EC2 instance and am trying to install MySQL 8. Every time I try different methods for installing it, I face the same problem. The error I get mentions that the MySQL installation has no candidate. I’ve attempted to refresh the package lists and explore various repositories, but nothing resolves the issue. Has anyone else experienced this? I need to set up MySQL 8 for a project, but this error is getting in the way. What might be causing this error, and how can I resolve it? Any help would be greatly appreciated.
Had this exact issue when migrating from Debian 11 to 12 last month. The problem is that MySQL 8.0 packages aren’t available in the default Debian 12 repositories due to licensing conflicts. What worked for me was manually adding the MySQL APT repository key first before installing the config package. You need to download the GPG key from MySQL’s keyserver and add it to your system, then install the mysql-apt-config deb package. After that, make sure to specify the exact MySQL version during apt update. Also check that your EC2 instance has enough resources allocated because MySQL 8 can be memory intensive during installation on smaller instances.
i think debian 12 might be using mariadb now, which coud be why you’re not seeing mysql in the repos. try adding the mysql official repo - download the mysql-apt-config package from mysql’s site, then run dpkg -i. after that, do apt update.