Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 05/01/2021, à 21:11

TryphonCosinus

[RESOLU] mariadb.service: Failed with result 'exit-code'

Bonjour et bonne année!

Voilà plusieurs jours que je cherche à installer et démarrer MariaDB. Ma config :

Ubuntu Server 20.04.1 sur partition de 100 GB (83 GB libre) et fraichement installé
Intel® Core™2 Quad CPU @ 2.40GHz × 4
RAM 8 GB
AMD Cayman graphic card

Tout fonctionne sauf MariaDB. La bible que je lis: https://doc.ubuntu-fr.org/mysql#reinstallation_complete
Mes devoirs :

sudo killall mysqld
sudo systemctl disable mysql.service
sudo rm -rf /lib/systemd/system/mysql.service
sudo rm -rf /usr/lib/systemd/system/mysql.service
sudo rm -rf /etc/systemd/system/multi-user.target.wants/mysql.service
sudo rm -rf /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/mysql.service
sudo rm -rf /var/cache/apt/archives/mysql-server-*.deb

sudo apt-get install -f
sudo dpkg --configure -a
sudo apt autoremove --purge ~n^mysql-server ~n^mariadb-server
sudo apt autoremove
sudo rm -rf /etc/mysql /var/lib/mysql
sudo mkdir -p /etc/mysql/conf.d
sudo apt clean
sudo apt update && sudo apt upgrade
sudo apt install mariadb-server

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
Setting up mariadb-server (1:10.3.25-0ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.3) ...

Démarrage de MariaDB:

sudo systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
sudo systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.25 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: [b]failed (Result: exit-code)[/b] since Tue 2021-01-05 14:18:16 EST; 10min ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 19511 (code=exited, status=7)
     Status: "MariaDB server is down"

Jan 05 14:18:14 UbuntuServer systemd[1]: Starting MariaDB 10.3.25 database server...
Jan 05 14:18:14 UbuntuServer mysqld[19511]: 2021-01-05 14:18:14 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824
Jan 05 14:18:14 UbuntuServer mysqld[19511]: 2021-01-05 14:18:14 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0ubuntu0.20.04.1-log) starting as process 19511 ...
Jan 05 14:18:16 UbuntuServer systemd[1]: mariadb.service: Main process exited, code=exited, status=7/NOTRUNNING
Jan 05 14:18:16 UbuntuServer systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 05 14:18:16 UbuntuServer systemd[1]: Failed to start MariaDB 10.3.25 database server.
journalctl -xe
-- 
-- A start job for unit systemd-hostnamed.service has begun execution.
-- 
-- The job identifier is 6785.
Jan 05 14:20:58 UbuntuServer dbus-daemon[893]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jan 05 14:20:58 UbuntuServer systemd[1]: Started Hostname Service.
-- Subject: A start job for unit systemd-hostnamed.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit systemd-hostnamed.service has finished successfully.
-- 
-- The job identifier is 6785.
Jan 05 14:21:28 UbuntuServer systemd[1]: systemd-hostnamed.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit systemd-hostnamed.service has successfully entered the 'dead' state.
Jan 05 14:23:08 UbuntuServer dbus-daemon[2693]: [session uid=1000 pid=2693] Activating service name='org.gnome.DiskUtility' requested by ':1.35' (uid=1000 pid=2903 comm="/usr/bin/gnome-shell " label="unconfined")
Jan 05 14:23:08 UbuntuServer dbus-daemon[2693]: [session uid=1000 pid=2693] Successfully activated service 'org.gnome.DiskUtility'
Jan 05 14:23:30 UbuntuServer PackageKit[18733]: daemon quit
Jan 05 14:23:30 UbuntuServer systemd[1]: packagekit.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit packagekit.service has successfully entered the 'dead' state.
Jan 05 14:28:59 UbuntuServer sudo[21020]:    rex : TTY=pts/0 ; PWD=/home/rex ; USER=root ; COMMAND=/usr/bin/systemctl status mariadb.service
Jan 05 14:28:59 UbuntuServer sudo[21020]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 05 14:29:21 UbuntuServer sudo[21020]: pam_unix(sudo:session): session closed for user root
Jan 05 14:29:49 UbuntuServer sudo[21052]:    rex : TTY=pts/0 ; PWD=/home/rex ; USER=root ; COMMAND=/usr/bin/systemctl status mariadb.service
Jan 05 14:29:49 UbuntuServer sudo[21052]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 05 14:30:01 UbuntuServer CRON[21065]: pam_unix(cron:session): session opened for user root by (uid=0)
Jan 05 14:30:01 UbuntuServer CRON[21066]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Jan 05 14:30:01 UbuntuServer CRON[21065]: pam_unix(cron:session): session closed for user root
Jan 05 14:30:51 UbuntuServer sudo[21052]: pam_unix(sudo:session): session closed for user root
Jan 05 14:31:04 UbuntuServer systemd[1]: Started Run anacron jobs.
-- Subject: A start job for unit anacron.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit anacron.service has finished successfully.
-- 
-- The job identifier is 6867.
Jan 05 14:31:04 UbuntuServer anacron[21103]: Anacron 2.3 started on 2021-01-05
Jan 05 14:31:04 UbuntuServer anacron[21103]: Normal exit (0 jobs run)
Jan 05 14:31:04 UbuntuServer systemd[1]: anacron.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit anacron.service has successfully entered the 'dead' state.
sudo mysqld --help --verbose | grep 'log-error' | tail -1
2021-01-05 14:36:13 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824
2021-01-05 14:36:13 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-05 14:36:13 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
2021-01-05 14:36:13 0 [ERROR] mysqld: unknown variable 'early-plugin-load='
2021-01-05 14:36:13 0 [ERROR] Aborting

MariaDB ne démarre pas. La procédure https://doc.ubuntu-fr.org/mysql#reinstallation_complete est insiffisante, incomplète ou non à jour.
Que faut-il faire pour que MariaDB démarre?

Merci!

Dernière modification par TryphonCosinus (Le 06/01/2021, à 11:00)


Asus P7P55D EVO, quadcore i7 2,8 GHz, Gainward Radeon HD4870, Samsung T240HD sur DisplayPort, TV Plasma Samsung sur HDMI, NAS QNAP TS-559

Hors ligne

#2 Le 06/01/2021, à 09:25

bruno

Re : [RESOLU] mariadb.service: Failed with result 'exit-code'

La doc est à jour. Par contre pas mal de commandes utilisées ne figurent pas dans la doc.

Je rappelle que journalctl -xe ne sert à rien s'il n'est pas exécuté immédiatement après une erreur (lire man journalctl). Pour voir le journal d'un service systemd il faut faire :

journalctl --no-pager -u mysql

Sinon on voit quand même des avertissements et une erreur bloquante grâce à la dernière commande.
Ces erreurs sont dues à des options de configuration invalides. Donc soit tu as modifié (ou conservé) la configuration locale sous /etc/mysql, soit tu as un autre fichier de configuration erroné ailleurs : /etc/my.cnf, /var/lib/mysql/my.cnf, /root/.my.cf, $HOME/.my.cnf, etc.

Tu peux déjà chercher dans /etc:

sudo rgrep early-plugin-load /etc

Hors ligne

#3 Le 06/01/2021, à 10:59

TryphonCosinus

Re : [RESOLU] mariadb.service: Failed with result 'exit-code'

Bonjour Bruno,

Bravo! il y avait bien un fichier /etc/my.cnf qui contenait la variable early-plugin-load. Je l'ai supprimé et j'ai enchainé sur :

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl start mariadb

et MariaDB a démarré.

Et non, je n'avais rien fait d'intentionnel pour écrire un fichier /etc/my.cnf. Mais contrairement aux indications du fichier /etc/mysql/my.cnf

The MariaDB/MySQL tools read configuration files in the following order:
1. "/etc/mysql/mariadb.cnf" to set global defaults,
2. "/etc/mysql/conf.d/*.cnf" to set global options.
3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
4. "~/.my.cnf" to set user-specific options.

If the same option is defined multiple times, the last one will apply.

d'autres emplacements de my.cnf prévallent pour configurer MariaDB. Il faut donc les supprimer aussi pour réinstaller MariaDB.

Je te remercie pour ton intuition à mettre le doigt rapidement sur mon problème.


Asus P7P55D EVO, quadcore i7 2,8 GHz, Gainward Radeon HD4870, Samsung T240HD sur DisplayPort, TV Plasma Samsung sur HDMI, NAS QNAP TS-559

Hors ligne