ubuntuusers.de

mySQL -> MariaDB fehlgeschlagen

Status: Ungelöst | Ubuntu-Version: Kubuntu 18.04 (Bionic Beaver)
Antworten |

michahe

Anmeldungsdatum:
12. Dezember 2013

Beiträge: 857

Hallo,

ich habe exakt nach der Wiki-Anleitung den Wechsel von mySQL auch Maria-DB versucht; schließlich gab es einen TimeOut-Fehler beim Installieren / Starten und ...

$ mysql -u root
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

$ sudo mysql -u root
Passwort
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 44
Server version: 10.1.38-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

Meine Datenbanken sind nicht in /var/lib/mysql sondern auf einer anderen Partition gespeichert; dazu war die /etc/mysql/mysql.conf.d/ entsprechend angepasst. Die ist jetzt weg, dafür gibt es einen Link auf /etc/alternatives/my.cnf, diese Datei verlinkt nach /etc/mysql/mariadb.cnf; in dieser steht nur

[client-server]
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

In der meinem Backup von steht:

[mysqld]
# * Basic Settings
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
#datadir		= /var/lib/mysql   # Original-Einstellung
datadir        = /mnt/Verzeichnis/Datenbanken/mySQL/mysql/
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking
#

Wie krieg' ich das wieder sauber aufgeräumt und gestartet?

Danke, Michael

michahe

(Themenstarter)

Anmeldungsdatum:
12. Dezember 2013

Beiträge: 857

Hallo nochmal,

ich habe jetzt alles von mySQL und MariaDB gelöscht und MariaDB neu installiert.

Jetzt möchte ich das Datenverzeichnis andern:

%sudo mysql -u root
MariaDB [(none)]> select @@datadir;
+-----------------+
| @@datadir       |
+-----------------+
| /var/lib/mysql/ |
+-----------------+

In allen Anleitungen, auch hier im Wiki, steht, man soll die Zeile "Datadir" in der Datei "/etc/mysql/my.cnf" anpassen. Diese Datei gibt es (hier) nicht (mehr):

$ /etc/mysql$ ls -l
insgesamt 24
drwxr-xr-x 2 root root 4096 Feb 23 18:44 conf.d
-rw------- 1 root root  277 Feb 23 18:44 debian.cnf
-rwxr-xr-x 1 root root 1509 Feb  6 06:53 debian-start
-rw-r--r-- 1 root root  869 Feb  6 06:53 mariadb.cnf
drwxr-xr-x 2 root root 4096 Feb 23 18:44 mariadb.conf.d
lrwxrwxrwx 1 root root   24 Feb 23 18:44 my.cnf -> /etc/alternatives/my.cnf
-rw-r--r-- 1 root root  839 Aug  3  2016 my.cnf.fallback

Die Datei "/etc/alternatives/my.cnf" verlinkt auf "/etc/mysql/mariadb.cnf" und in der steht nur:

# The MariaDB configuration file
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) 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.
[client-server]
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

Nur in der Datei "/etc/mysql/mariadb.conf.d/50-server.cnf" gibt es dann eine Zeile "datadir = /var/lib/mysql"; ist das die zu ändernde Zeile?

Antworten |