<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Update - Matteo Cisilino</title>
	<atom:link href="https://www.cisilino.com/de/tag/update/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cisilino.com/de/</link>
	<description>Guide su WordPress, server e sicurezza</description>
	<lastBuildDate>Thu, 29 Oct 2026 19:02:04 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>MySQL startet nach dem Debian-12-Upgrade nicht mehr: Ursache und Lösung</title>
		<link>https://www.cisilino.com/de/2026/10/13/mysql-startet-nicht-debian-12/</link>
					<comments>https://www.cisilino.com/de/2026/10/13/mysql-startet-nicht-debian-12/#respond</comments>
		
		<dc:creator><![CDATA[matteocisilino]]></dc:creator>
		<pubDate>Tue, 13 Oct 2026 07:50:06 +0000</pubDate>
				<category><![CDATA[Server und Datenbanken]]></category>
		<category><![CDATA[Debian 12]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Update]]></category>
		<guid isPermaLink="false">https://www.cisilino.com/?p=267</guid>

					<description><![CDATA[<p>Nach dem Upgrade auf Debian 12 startet MySQL nicht mehr, und in den Logs taucht mariadb.conf.d auf. So erkennen Sie die Ursache und beheben sie, ohne die Daten anzufassen.</p>
<p>The post <a href="https://www.cisilino.com/de/2026/10/13/mysql-startet-nicht-debian-12/">MySQL startet nach dem Debian-12-Upgrade nicht mehr: Ursache und Lösung</a> first appeared on <a href="https://www.cisilino.com/de/">Matteo Cisilino</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2 class="wp-block-heading">Das Symptom: MySQL startet nicht mehr (mysql.service failed)</h2>
<p>MySQL startet nicht mehr: Der Dienst ist fehlgeschlagen, und das Log meldet den Fehler <code>Can't read dir of '/etc/mysql/mariadb.conf.d/'</code>.</p>
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" src="https://www.cisilino.com/wp-content/uploads/2026/10/mysql-startet-nicht-debian-12-update.webp" alt="MySQL startet nicht mehr: ein Zylinder als Sinnbild einer Datenbank mit einem orangefarbenen Warnkreis daneben" width="1200" height="630"/></figure>
<pre class="wp-block-code"><code># service mysql status
× mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; preset: enabled)
     Active: failed (Result: exit-code)
     Status: "Server startup in progress"

mysqld: Can't read dir of '/etc/mysql/mariadb.conf.d/' (OS errno 2 - No such file or directory)
mysqld: &#91;ERROR] Stopped processing the 'includedir' directive in file /etc/mysql/my.cnf at line 29.
mysqld: &#91;ERROR] Fatal error in defaults handling. Program aborted!
systemd&#91;1]: Failed to start mysql.service - MySQL Community Server.</code></pre>
<p>Beim Prüfen der installierten Pakete ist MySQL ganz normal vorhanden (<code>mysql-community-server</code>-8.0-Pakete aus dem offiziellen Oracle-Repository).</p>
<pre class="wp-block-code"><code>dpkg -l | grep mysql</code></pre>
<h2 class="wp-block-heading">Die Ursache: Die Alternative my.cnf zeigt auf mariadb.cnf</h2>
<p>Unter Debian ist die Datei <code>/etc/mysql/my.cnf</code> keine echte Datei, sondern ein Link, der von <strong>update-alternatives</strong> verwaltet wird. Mehrere Pakete können ihre eigene Version registrieren, und im automatischen Modus gewinnt die mit der höchsten Priorität.</p>
<p>Beim Upgrade wurde das Paket <strong>mariadb-common</strong> installiert (und danach entfernt), das <code>/etc/mysql/mariadb.cnf</code> mit <strong>Priorität 500</strong> registriert, höher als <code>/etc/mysql/mysql.cnf</code> (Priorität 300). Das Paket wurde entfernt, aber nicht vollständig gelöscht (Status <code>rc</code>), sodass seine Konfiguration aktiv blieb. In Zeile 29 dieser Datei steht das Include von <code>/etc/mysql/mariadb.conf.d/</code>, einem Verzeichnis, das nicht existiert: MySQL liest die Konfiguration, findet das Verzeichnis nicht und bricht ab. Das Ergebnis: „MySQL startet nicht mehr“, obwohl die Pakete in Ordnung sind.</p>
<p><strong>Die gute Nachricht:</strong> Die Daten in <code>/var/lib/mysql</code> wurden nicht angetastet. Es ist nur ein Konfigurationsproblem.</p>
<h2 class="wp-block-heading">Diagnose: prüfen, worauf my.cnf zeigt</h2>
<pre class="wp-block-code"><code>ls -l /etc/mysql/my.cnf /etc/alternatives/my.cnf
update-alternatives --display my.cnf
sed -n '25,32p' /etc/mysql/my.cnf
dpkg -l | grep -i mariadb</code></pre>
<p>Wenn das Problem hier liegt, sieht die Ausgabe ähnlich aus wie diese.</p>
<pre class="wp-block-code"><code>/etc/alternatives/my.cnf -&gt; /etc/mysql/mariadb.cnf
/etc/mysql/my.cnf -&gt; /etc/alternatives/my.cnf

my.cnf - modalità automatica
  la versione migliore del collegamento è /etc/mysql/mariadb.cnf
  il collegamento attualmente punta a /etc/mysql/mariadb.cnf
/etc/mysql/mariadb.cnf - priorità 500
/etc/mysql/my.cnf.fallback - priorità 100
/etc/mysql/mysql.cnf - priorità 300

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

rc  mariadb-common   1:10.11.18-0+deb12u1   all   MariaDB common configuration files</code></pre>
<h2 class="wp-block-heading">Lösung Schritt für Schritt</h2>
<h3 class="wp-block-heading">1. Die Konfiguration sichern</h3>
<pre class="wp-block-code"><code>cp -a /etc/mysql /root/etc-mysql-backup-$(date +%F)</code></pre>
<h3 class="wp-block-heading">2. Die Reste von mariadb-common entfernen</h3>
<p>Das Purge entfernt <code>mariadb.cnf</code> und den zugehörigen Eintrag in update-alternatives.</p>
<pre class="wp-block-code"><code>apt purge mariadb-common</code></pre>
<h3 class="wp-block-heading">3. my.cnf wieder auf mysql.cnf zeigen lassen</h3>
<pre class="wp-block-code"><code>update-alternatives --remove my.cnf /etc/mysql/mariadb.cnf 2&gt;/dev/null
update-alternatives --set my.cnf /etc/mysql/mysql.cnf</code></pre>
<h3 class="wp-block-heading">4. Die Konfiguration prüfen</h3>
<pre class="wp-block-code"><code>update-alternatives --display my.cnf
cat /etc/mysql/my.cnf
my_print_defaults mysqld</code></pre>
<p>Jetzt muss <code>my.cnf</code> auf <code>/etc/mysql/mysql.cnf</code> zeigen und <code>/etc/mysql/conf.d/</code> sowie <code>/etc/mysql/mysql.conf.d/</code> einbinden. Gibt <code>my_print_defaults mysqld</code> die Parameter ohne Fehler aus, ist die Konfiguration korrekt.</p>
<h3 class="wp-block-heading">5. MySQL starten</h3>
<pre class="wp-block-code"><code>systemctl start mysql
systemctl status mysql
journalctl -u mysql -n 50 --no-pager</code></pre>
<h2 class="wp-block-heading">Wenn my.cnf kein symbolischer Link ist</h2>
<p>Ist <code>/etc/mysql/my.cnf</code> eine normale Datei oder existiert <code>/etc/mysql/mysql.cnf</code> nicht, können Sie die Konfiguration von Hand neu anlegen.</p>
<pre class="wp-block-code"><code>mv /etc/mysql/my.cnf /etc/mysql/my.cnf.mariadb.bak
cat &gt; /etc/mysql/my.cnf &lt;&lt;'EOF'
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
EOF
mkdir -p /etc/mysql/conf.d
systemctl start mysql</code></pre>
<h2 class="wp-block-heading">Schnelle vorläufige Lösung für „MySQL startet nicht mehr“</h2>
<p>Muss die Datenbank sofort wieder online, genügt es, das fehlende Verzeichnis anzulegen. Das ist aber nur ein Provisorium: MySQL würde weiterhin die für MariaDB gedachte Konfiguration lesen, daher wenden Sie die vollständige Lösung besser so bald wie möglich an.</p>
<pre class="wp-block-code"><code>mkdir /etc/mysql/mariadb.conf.d &amp;&amp; systemctl start mysql</code></pre>
<h2 class="wp-block-heading">Wie Sie verhindern, dass es wieder passiert</h2>
<p>Es lohnt sich herauszufinden, welches Upgrade MariaDB installiert hat, anhand des apt-Verlaufs. Wie wir MySQL 5.7 in Docker betreiben, ohne es dem Internet auszusetzen, steht in <a href="https://www.cisilino.com/de/2026/10/17/mysql-5-7-docker-nftables-schutz/">diesem Artikel</a>. Was sich in Debian 12 geändert hat, erklären die <a href="https://www.debian.org/releases/bookworm/amd64/release-notes/" target="_blank" rel="noopener">Release Notes zu Debian 12</a>.</p>
<pre class="wp-block-code"><code>grep -i -B3 -A3 mariadb /var/log/apt/history.log*</code></pre>
<p>Damit <code>mariadb-common</code> künftig nicht erneut installiert wird, kann man es mit einem APT-Pin mit negativer Priorität sperren.</p>
<pre class="wp-block-code"><code>cat &gt; /etc/apt/preferences.d/no-mariadb &lt;&lt;'EOF'
Package: mariadb-*
Pin: release *
Pin-Priority: -1
EOF</code></pre>
<p>Nach jedem größeren Upgrade ist es außerdem gute Praxis, den Status der Alternative mit <code>update-alternatives --display my.cnf</code> zu prüfen.</p>
<h2 class="wp-block-heading">Häufig gestellte Fragen</h2>
<h3 class="wp-block-heading">MySQL startet nicht mehr: Verliere ich die Daten meiner Datenbanken?</h3>
<p>Nein. Das Problem betrifft nur die Konfigurationsdateien in <code>/etc/mysql</code>; die Daten in <code>/var/lib/mysql</code> bleiben unversehrt.</p>
<h3 class="wp-block-heading">Warum hat Debian mariadb.cnf gewählt?</h3>
<p>Weil die Alternative <code>my.cnf</code> im automatischen Modus war und <code>mariadb.cnf</code> Priorität 500 hat, höher als die 300 von <code>mysql.cnf</code>. Mit <code>update-alternatives --set</code> wird die Auswahl manuell und ändert sich nicht mehr von selbst.</p>
<h3 class="wp-block-heading">Gilt das auch für Ubuntu?</h3>
<p>Ja, der Mechanismus von <code>update-alternatives</code> für <code>my.cnf</code> ist unter Ubuntu und den anderen von Debian abgeleiteten Distributionen derselbe.</p>
<h2 class="wp-block-heading">Fazit</h2>
<p>Der Fehler <strong>„Can&#8217;t read dir of /etc/mysql/mariadb.conf.d/“</strong> nach einem Debian-Upgrade bedeutet keinen Schaden an MySQL, sondern eine MariaDB-Restkonfiguration, die über update-alternatives aktiv geblieben ist. Wenn Sie <code>mariadb-common</code> mit <code>apt purge</code> entfernen und <code>my.cnf</code> wieder auf <code>mysql.cnf</code> setzen, läuft MySQL wieder normal.</p></p><p>The post <a href="https://www.cisilino.com/de/2026/10/13/mysql-startet-nicht-debian-12/">MySQL startet nach dem Debian-12-Upgrade nicht mehr: Ursache und Lösung</a> first appeared on <a href="https://www.cisilino.com/de/">Matteo Cisilino</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.cisilino.com/de/2026/10/13/mysql-startet-nicht-debian-12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
