All we need is an easy explanation of the problem, so here it is.
I installed MySQL using
dnf (I’m on fedora) and from the officials rpm on the website. Both had the same problem : I have an error when I do
systemctl start mysqld.service.
So I checked
systemctl status mysqld.service and got this :
● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2021-04-07 17:07:54 CEST; 6s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 39884 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Process: 39913 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE) Main PID: 39913 (code=exited, status=1/FAILURE) Status: "Data Dictionary upgrade from MySQL 5.7 in progress" CPU: 734ms avril 07 17:07:53 laptop-de-mathis systemd: Starting MySQL Server... avril 07 17:07:53 laptop-de-mathis mysqld_pre_systemd: No such file or directory avril 07 17:07:53 laptop-de-mathis mysqld_pre_systemd: No such file or directory avril 07 17:07:53 laptop-de-mathis python3: detected unhandled Python exception in '/usr/sbin/semanage' avril 07 17:07:53 laptop-de-mathis mysqld_pre_systemd: No such file or directory avril 07 17:07:53 laptop-de-mathis python3: detected unhandled Python exception in '/usr/sbin/semanage' avril 07 17:07:53 laptop-de-mathis mysqld_pre_systemd: No such file or directory avril 07 17:07:54 laptop-de-mathis systemd: mysqld.service: Main process exited, code=exited, status=1/FAILURE avril 07 17:07:54 laptop-de-mathis systemd: mysqld.service: Failed with result 'exit-code'. avril 07 17:07:54 laptop-de-mathis systemd: Failed to start MySQL Server.
I don’t really know what to do with this information. I also checked
journalctl, but StackExchange considers it as spam, so I can’t post it.
Does anyone have an idea how to get me out of this situation?
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
As mentioned in the comments, the
/usr/sbin/semanage file was not working properly. After using the
dnf provides command (
dnf provides /usr/sbin/semanage), dnf told me that this file was from the
policycoreutils-python-utils-3. 1-4.fc33.noarch, so I reinstalled it with
dnf reinstall (
dnf reinstall policycoreutils-python-utils-3.1-4.fc33.noarch), rebooted, and my problem was solved.
However, I ran into another problem, again in the same place, which I’ve listed here.
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂