After upgrading to Fedora 42, problems with the MySQL database due to downgrading

After upgrading to Fedora 42, problems with the MySQL database due to downgrading

First of all, it took me three hours of troubleshooting to solve the problem. I took a day off because it requires the utmost concentration. It’s not something you can do on the side.

What is troubleshooting?

Troubleshooting involves fault finding and fault correction and is a systematic approach to problem solving that is often used to find and eliminate problems in complex machines, electronics, computers and software systems. The first step in most troubleshooting methods is to gather information about the problem, for example, undesirable behaviour or the absence of expected functionality.

Source: https://www.computerweekly.com/de/definition/Fehlersuche-Troubleshooting

Initial situation

Fedora 41 with a MySQL database, which, thanks to a tip from a user on the LinkedIn business network, was called 9.2 instead of 8.4. A version that is probably not very common.

Upgrade performed on Thursday, 30 October 2025. The programme that performed the download in Fedora with the command sudo dnf system-upgrade download –releasever=42 downgraded the existing version 9.2 to 8.4.7. This also meant that version 9.2 was uninstalled during the upgrade.

I am very familiar with the command line, so I use it a lot. Black and white boxes with text are nothing new to me. In fact, it’s part of my everyday routine. The colourful icons are really just a facade that has been embellished.

First problem

Fedora refused to start the MySQL server.

When I say server, I mean a service and not a standalone PC located somewhere in a data centre. What systemd is for Linux, services.msc is for Windows.

There was an incompatibility in the folder directory. The path of /var/lib/mysql was not correct for my version. A complete reinitialisation of the database structure was carried out. A new structure for the new, but older version, was created and the permissions were set. The command sudo mysqld –initialise –user=mysql –datadir=/var/lib/mysql was used for this. Root rights can also be established temporarily with sudo. You do not always need the root password (or the admin password – if you transfer it to MS Windows) to do this.

What is reinitialisation?

Establishing a specific initial state of a computer, programme, procedure or object. In the case of programmes and other software units, assigning all variables before the first application to ensure that the programme runs correctly [Use: IT].

Source: https://www.wortbedeutung.info/Initialisierung/

The server was finally running, but the client, the programme and the database could not connect. The following error message always appeared when attempting to connect: ‘ERROR 2002 Can’t connect to local MySQL server through socket ‚/tmp/mysql.sock’

There was also a problem with the path here. The server searched for the mysql.sock file in /var/run/mysqld, but the client was configured differently.

Determine the actual location of the socket file. I did this here with this long command sudo find / -type f -iname „mysql.sock“ 2>/dev/null Search the ‘admin directory’ only for files with the name mysql.sock – ignore upper and lower case. To avoid seeing error messages, which often only cause uncertainty and distraction, and to see only the pure result, error messages are sent to nirvana. This is done in Linux with .

MySQL also has a configuration file where all the paths are stored. The file is called my.cnf and is located in the /etc/ directory, at least in Fedora. The correct path /var/run/mysqld/mysql.sock was added to the [mysqld] and [client] sections. I had to add the [client] section manually.
Nano war and the password trap

The command mysqld_safe –skip-grant-tables does not work in the command line because mysqld_safe was not recognised, probably because it no longer exists.

Some instructions on the internet are not always up to date. It may be that my blog entry will work differently in five years‘ time because something has changed. That’s why I’m only describing the current status as of 30 October 2025. Nostalgics will find this entry very interesting in five years‘ time.

So I finally used sudo systemctl edit mysqld to open a temporary configuration file, which opened the nano editor.

Three lines needed to be inserted:

[Service]

ExecStart=

ExecStart=/usr/bin/mysqld –skip-grant-tables

This failed, which I didn’t realise the first few times. After saving with CTRL + O and CTRL + X, the message ‘new contents are empty, not writing file’ appeared in yellow font, but I just took it as information. There are many yellow lines, like messages that you read through but don’t pay any attention to. I should have taken this message seriously, because Nano didn’t save anything.

That’s why I used the long command. echo -e „[Service]\nExecStart=\nExecStart=/usr/bin/mysqld –skip-grant-tables“ | sudo tee /etc/systemd/system/mysqld.service.d/override.conf

Now the information was finally saved properly.

After that, I was finally able to log into the database as root with mysql -u root.

There were still a few hurdles to overcome, but in the end I was able to set the root password. I tested it once, and it worked. Then I had to add myself back as a new user for this database. Now the database is working again.

The graphical programme DBbeaver CE can also connect to the database again. DBbeaver is a graphical interface – not only for MySQL – where you can conveniently access database management systems, as they are correctly called.

I have published my struggle here below with the individual commands. I have not published the commands where a password is visible.

How did I document the commands?

I didn’t. The command line does that itself. There is a command for this called history. There are similar commands for PowerShell / CMD in Windows. Then I copied everything here.

My struggle as commands

sudo systemctl status mysqld
813 sudo systemctl start mysqld
814 sudo systemctl status mongod
815 mysql –version
816 sudo journalctl -xeu mysqld.service
817 sudo journalctl -xeu mysqld.service > meldungen.txt
818 gedit meldungen.txt
819 sudo systemctl stop mysqld
820 sudo systemctl status mongod
821 sudo systemctl status mysqld
822 sudo mv /var/lib/mysql /var/lib/mysql_old_9.2
823 clear
824 sudo mysqld –initialize –user=mysql –datadir=/var/lib/mysql
825 sudo chown -R mysql:mysql /var/lib/mysql
826 sudo systemctl start mysqld
827 sudo systemctl status mysqld
828 sudo systemctl enable mysqld
829 sudo systemctl status mysqld
830 clear
831 mysql -u sven -p
832 mysql_secure_installation
833 sudo systemctl status mysqld
834 sudo mysql_secure_installation
835 mysql -u root -p
836 sudo systemctl stop mysqld
837 sudo systemctl status mysqld
838 sudo mysqld_safe –skip-grant-tables &
839 mysql -u root
840 sudo mysqld_safe –skip-grant-tables
841 sudo systemctl edit mysqld
842 sudo systemctl daemon-reload
843 sudo systemctl start mysqld
844 sudo systemctl status mysqld
845 mysql -u root
846 rpm -qa | grep mysql-server
847 rpm -qa | grep mysql
848 sudo restorecon -R /var/lib/mysql
849 sudo systemctl restart mysqld
850 sudo systemctl stop mysqld
851 sudo systemctl edit mysqld
852 systemctl daemon-reload
853 sudo systemctl daemon-reload
854 sudo systemctl start mysqld
855 mysql -u root
856 cd /etc/
857 ls
858 cd my.cnf.d/
859 ls
860 cd ..
861 cat my.cnf

The path did not match and SELinux permissions had to be reset.


862 cd
863 sudo chcon -t mysqld_var_run_t /var/lib/mysql/mysql.sock
864 ls -l /run/mysqld/mysql
865 sudo ls -l /run/mysqld/mysql
866 sudo ls -l /run/mysqld
867 sudo nano /etc/my.cnf
868 sudo mkdir -p /var/run/mysqld
869 sudo chown mysql:mysql /var/run/mysqld
870 sudo systemctl daemon-reload
871 sudo systemctl restart mysqld
872 sudo systemctl status mysql.service
873 sudo systemctl status mysqld
874 sudo systemctl start mysqld
875 sudo mkdir -p /var/run/mysqld
876 sudo chown mysql:mysql /var/run/mysqld
877 sudo restorecon -R /var/run/mysqld
878 sudo systemctl restart mysqld
879 journalctl -xeu mysqld.service > meldungen2.txt
880 gedit meldungen2.txt
881 cat /etc/my.cnf
882 cat /var/log/mysqld.log
883 sudo cat /var/log/mysqld.log
884 sudo cat /var/log/mysqld.log > mysql_log.txt
885 gedit mysql_log.txt
886 find / -type -f -iname my.cnf
887 find / -type f -iname my.cnf
888 sudo find / -type f -iname my.cnf
889 sudo mkdir -p /var/run/mysql
890 sudo chown mysql:mysql /var/run/mysql
891 sudo restorecon -R /var/run/mysql
892 sudo systemctl restart mysqld && sudo systemctl status mysqld
893 mysql -u root
894 cat /etc/my.cnf
895 mysql -u root –socket=/var/lib/mysql/mysql.sock
896 cd /var/lib/mysql
897 sudo cd /var/lib/mysql
898 sudo cd /var/lib
899 sudo cd /var/
900 pwd
901 sudo cd var/
902 cd /var/
903 cd lib
904 ls
905 cd mysql
906 sudo cd mysql
907 su
908 cd
909 find / -type f -iname „.sock
910 sudo find / -type f -iname „mysql.sock“ 2>/dev/null
911 sudo nano /etc/my.cnf
912 sudo rm -rf /var/run/mysql
913 sudo mkdir -p /run/mysqld
914 sudo chown mysql:mysql /run/mysqld
915 sudo restorecon -R /run/mysqld
916 sudo systemctl restart mysqld
917 sudo systemctl status mysqld
918 mysql -u root
919 sudo find / -type f -iname „mysql.sock“ 2>/dev/null
920 sudo mkdir -p /run/mysqld/mysql_sock_old
921 sudo ls /run/mysqld/
922 cp /run/mysqld/mysql.sock.lock /run/mysqld/mysql_sock_old
923 sudo cp /run/mysqld/mysql.sock.lock /run/mysqld/mysql_sock_old
924 sudo ls /run/mysqld/
925 cd /run/mysqld/
926 ls
927 ls mysql_sock_old/
928 mv mysql.sock.lock mysql.sock
929 sudo mv mysql.sock.lock mysql.sock
930 cd
931 mysql -u root
932 cd /run/mysqld/
933 ls
934 cat mysql.sock
935 sudo cat mysql.sock
936 sudo cat mysqld.pid
937 sudo mv mysql.sock mysql.sock.lock
938 ls
939 cd
940 sudo systemctl stop mysqld
941 sudo rm -f /run/mysqld/sock
942 cd /run/mysqld/
943 ls
944 sudo rm -rf mysql_sock_old/
945 cd
946 sudo systemctl start mysqld
947 sudo tail -n 50 /var/log/mysqld.log > mysql_log_letzte_50.txt
948 gedit mysql_log_letzte_50.txt
949 mysql -u root –socket=/var/run/mysqld/mysql.sock
950 sudo systemctl stop mysqld
951 sudo /usr/bin/mysqld_safe –skip-grant-tables &
952 sudo systemctl edit mysqld
953 sudo systemctl daemon-reload && sudo systemctl restart mysqld && sudo systemctl status mysqld
954 mysql -u root –socket=/run/mysqld/mysql.sock
955 mysql -u root -p
956 mysql -u root
957 mysql -u sven
958 mysql -u sven -p
959 sudo nano /etc/my.cnf
960 mysql -u root
961 mysql
962 sudo systemctl edit mysqld
963 cd /etc/systemd/system/
964 ls
965 clear && ls
966 pwd
967 cd
968 history | grep find
969 sudo find / -type f -iname „mysqld.ser“ 2>/dev/null
970 sudo nano /etc/my.cnf
971 sudo systemctl edit mysqld
972 sudo mkdir -p /etc/systemd/system/mysqld.service.d
973 echo -e „[Service]\nExecStart=\nExecStart=/usr/bin/mysqld –skip-grant-tables“ | sudo tee /etc/systemd/system/mysqld.service.d/override.conf
974 cat /etc/systemd/system/mysqld.service.d/override.conf
975 sudo systemctl daemon-reload && sudo systemctl restart mysqld && sudo systemctl status mysqld
976 mysql -u root –socket=/var/run/mysqld/mysql.sock

This shows passwords that I do not publish.


980 mysql -u root –socket=/var/run/mysqld/mysql.sock
981 sudo rm /etc/systemd/system/mysqld.service.d/override.conf && sudo systemctl daemon-reload && sudo systemctl restart mysqld
982 mysql -u root –socket=/var/run/mysqld/mysql.sock
983 sudo systemctl restart mysqld

Die Kommentare sind geschlossen.