MySQL 8.0 Community Server 27 MB/s | 27 kB 00:00
GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql (0x5072E1F5) is already installed
The GPG keys listed for the “MySQL 8.0 Community Server” repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository… Failing package is: mysql80-community-release-el8-4.noarch
That’s not a Rocky provided repository. That seems to be something you downloaded most likely from here: MySQL :: Download MySQL Yum Repository is that correct? If so, then it seems Oracle needs to resolve that if the GPG doesn’t work.
Perhaps it would be better for you to remove that repository and use the provided mariadb-server package that exists in Rocky repositories.
Well, assuming it was installed via rpm, you can try this to verify first:
rpm -qa | grep -i mysql
If it returns a package list, maybe it’s called mysql-community-repository or something like that, so you could then do:
dnf remove mysql-community-repository
replace with whatever results were returned for the first command. Alternatively, if it downloaded a .repo file, then look what files you have in /etc/yum.repos.d and delete the one relating to mysql.
However, I don’t recommend deleting the repo file from /etc/yum.repos.d if you still leave the rpm for the repository installed. That is why verify with the rpm command first.
If you are unsure, post the results of the first command I posted, so we can help you remove the correct one.
dnf remove mysql-\*
# If the list looks sane, then 'y'
dnf list installed | grep -i mysql
# That should list only the mysql80-community-release
# If yes, then
dnf remove mysql80-community-release
The dnf has also a log of what one has done and when. One could look at it:
after remove the the faulty repo as mentioned earlier run
dnf install mysql
and ofcourse mariadb as @iwalker is there which is compatible with oracle db and mysql (ofcourse not 100 %) in case you wanted to switch database later
Sorry that TID is about as useful as a chocolate teapot. It’s more or less the same as the one I just removed and dnf install mysql installed something but I have NO idea how to work with it and the docs you suggested don’t fit.
dnf install mysql install mysql database but from the rocky repository and the link i mentioned is the doc for mysql despite where you installed it from (from rocky repo or mysql repo)
using the follwing command systemctl status mysql would check if the mysql service/server is running systemctl start mysql would start the service if it not started yet
not sure if using gui tool to work with mysql would be good for you then install workbench would help alot
Complete!
[root@rocky-86 ~]# dnf list installed | grep -i mysql
mysql80-community-release.noarch el8-1 @System
[root@rocky-86 ~]# dnf remove mysql80-community-release
Dependencies resolved.
Package Architecture Version Repository Size
Removing:
mysql80-community-release noarch el8-1 @System 29 k
Transaction Summary
Remove 1 Package
Freed space: 29 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : mysql80-community-release-el8-1.noarch 1/1
Verifying : mysql80-community-release-el8-1.noarch 1/1
Removed:
mysql80-community-release-el8-1.noarch
Complete!
[root@rocky-86 ~]# dnf history list mysql
ID | Command line | Date and time | Action(s) | Altered
It’s also good to learn the tools available to see if packages are already available in Rocky or not. For example, instead of installing mysql-community at the beginning, you could have done things like:
dnf list mysql*
or:
dnf search mysql
then you would have seen a list of all the packages available, including mysql-server. If packages are not available by default, then at this point it either means additional repositories may need to be enabled or even use third party ones like mysql-community but that is really only in rare situations unless you have a need for using that particular version rather than the one by default.
I prefer mariadb-server, it’s practically the same as mysql, the difference - Oracle maintain mysql, whereas mariadb-server is maintained by a community.