Latest update fails

I tried to update and got this:

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.

ok, how do delete the wrong repository?

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.

[root@rocky-86 ~]# rpm -qa | grep -i mysql
mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql80-community-release-el8-1.noarch
mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-errmsg-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64

I’d guess

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:

dnf history list mysql

Hello @Mikheil

plus what @iwalker and @jlehtone said

rocky also has mysql if you like to use 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

and have a nice day everyone

Done, installed mysql as advised, Where do I find how to start it, secure it and control it?

There’s a lot of 'HowTos out there, but none of them seem to work

this one would help

https://dev.mysql.com/doc/refman/8.0/en/postinstallation.html

check the start section and secure the initial mysql account this will remove the demo account and make you set password and so on

hope that help and have a nice day :slight_smile:

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

https://www.mysql.com/products/workbench/

https://dev.mysql.com/downloads/workbench/

Rocky is an enterprise o/s, so you should stick to the official docs

[root@rocky-86 ~]# rpm -qa | grep -i mysql
mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql80-community-release-el8-1.noarch
mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-errmsg-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
[root@rocky-86 ~]# dnf remove mysql-*
Dependencies resolved.

Package Arch Version Repository Size

Removing:
mysql-common x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 @appstream 460 k
mysql-errmsg x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 @appstream 8.8 M
mysql-server x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 @appstream 121 M
Removing dependent packages:
mysql x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 @appstream 63 M
Removing unused dependencies:
mariadb-connector-c-config
noarch 3.1.11-2.el8_3 @appstream 497
mecab x86_64 0.996-1.module+el8.3.0+242+87d3366a.9 @appstream 2.1 M
protobuf-lite x86_64 3.5.0-13.el8 @appstream 450 k

Transaction Summary

Remove 7 Packages

Freed space: 195 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x8 1/1
Running scriptlet: mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x8 1/7
Erasing : mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x8 1/7
Running scriptlet: mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x8 1/7
Erasing : mysql-errmsg-8.0.26-1.module+el8.4.0+652+6de068a7.x8 2/7
Erasing : mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64 3/7
Erasing : mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x8 4/7
Erasing : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 5/7
Erasing : mecab-0.996-1.module+el8.3.0+242+87d3366a.9.x86_64 6/7
Running scriptlet: mecab-0.996-1.module+el8.3.0+242+87d3366a.9.x86_64 6/7
Erasing : protobuf-lite-3.5.0-13.el8.x86_64 7/7
Running scriptlet: protobuf-lite-3.5.0-13.el8.x86_64 7/7
Verifying : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 1/7
Verifying : mecab-0.996-1.module+el8.3.0+242+87d3366a.9.x86_64 2/7
Verifying : mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64 3/7
Verifying : mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x8 4/7
Verifying : mysql-errmsg-8.0.26-1.module+el8.4.0+652+6de068a7.x8 5/7
Verifying : mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x8 6/7
Verifying : protobuf-lite-3.5.0-13.el8.x86_64 7/7

Removed:
mariadb-connector-c-config-3.1.11-2.el8_3.noarch
mecab-0.996-1.module+el8.3.0+242+87d3366a.9.x86_64
mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-errmsg-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-server-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
protobuf-lite-3.5.0-13.el8.x86_64

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

20 | remove mysql-*            | 2022-07-22 18:46 | Removed        |    7  <
18 | install mysql             | 2022-07-17 13:00 | Install        |    3 > 

[root@rocky-86 ~]# dnf install mysql
Last metadata expiration check: 3:46:52 ago on Fri 22 Jul 2022 03:01:58 PM CEST.
Dependencies resolved.

Package Arch Version Repo Size

Installing:
mysql x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 appstream 12 M
Installing dependencies:
mariadb-connector-c-config
noarch 3.1.11-2.el8_3 appstream 14 k
mysql-common x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 appstream 133 k

Transaction Summary

Install 3 Packages

Total download size: 12 M
Installed size: 63 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): mariadb-connector-c-config-3.1.11-2.el8_ 3.3 kB/s | 14 kB 00:04
(2/3): mysql-common-8.0.26-1.module+el8.4.0+652 32 kB/s | 133 kB 00:04
(3/3): mysql-8.0.26-1.module+el8.4.0+652+6de068 2.0 MB/s | 12 MB 00:05

Total 1.3 MB/s | 12 MB 00:09
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 1/3
Installing : mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x8 2/3
Installing : mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64 3/3
Running scriptlet: mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64 3/3
Verifying : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 1/3
Verifying : mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64 2/3
Verifying : mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x8 3/3

Installed:
mariadb-connector-c-config-3.1.11-2.el8_3.noarch
mysql-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64
mysql-common-8.0.26-1.module+el8.4.0+652+6de068a7.x86_64

Complete!

[root@rocky-86 ~]# systemctl status mysql
Unit mysql.service could not be found.

Just because I’m old, I can still read and I did everything suggested.

You only installed the client-side stuff, you need the mysql server too.

dnf install mysql-server

when you finally have that installed;

systemctl enable mysqld
systemctl start mysqld

sorry i used to install it from oracle repo so

do the following

dnf module install mysql:8.0/server
then you will find the service file get created
using this systemctl status mysqld

hope that help and have a nice day :slight_smile:

Thanks. It works when you get the correct instructions.

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.