
Einleitung
Ich verwende MariaDB und Apache auf meiner Linux-Maschine und heute sind mir einige Probleme begegnet.
Ich verbinde mich über SSH mit dem Server und hier sind einige der Probleme, mit denen ich konfrontiert bin. Ich habe absolut keine Ahnung, was ich hier mache.
Was mache ich
Schritt 1:mysql -u USERNAME -p
FEHLER 2002 (HY000): Verbindung zum lokalen MySQL-Server über Socket '/var/run/mysqld/mysqld.sock' nicht möglich (2 „Keine solche Datei oder kein solches Verzeichnis“).
Ok, also dachte ich, lass uns versuchen, den MySQL-Dienst zu stoppen
Schritt 2:sudo service mysql stop
Ok, keine Fehler, also starten Sie den Dienst neu
Schritt 3:sudo service mysql restart
Job für mysql.service ist fehlgeschlagen. Weitere Informationen finden Sie unter „systemctl status mysql.service“ und „journalctl -xe“.
Ok, also führe ich diese beiden Befehle besser aus und schaue, was ich bekomme
Schritt 4:status mysql.service
Hmm... ok, versuchen wir es mit dem anderen
Schritt 5:journalctl -xe
Es wurden keine Journaldateien gefunden.
Ok, ich bin hier verloren...
MySQL-Fehlerprotokoll
150824 14:42:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150824 14:42:58 [Note] /usr/sbin/mysqld (mysqld 10.0.20-MariaDB-0ubuntu0.15.04.1) starting as process 22637 ...
150824 14:42:58 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
150824 14:42:58 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
150824 14:42:58 [ERROR] Plugin 'Aria' init function returned error.
150824 14:42:58 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
150824 14:42:58 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150824 14:42:58 [Note] InnoDB: The InnoDB memory heap is disabled
150824 14:42:58 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
150824 14:42:58 [Note] InnoDB: Memory barrier is not used
150824 14:42:58 [Note] InnoDB: Compressed tables use zlib 1.2.8
150824 14:42:58 [Note] InnoDB: Using Linux native AIO
150824 14:42:58 [Note] InnoDB: Using CPU crc32 instructions
150824 14:42:58 [Note] InnoDB: Initializing buffer pool, size = 128.0M
150824 14:42:58 [Note] InnoDB: Completed initialization of buffer pool
150824 14:42:58 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
150824 14:42:58 [ERROR] InnoDB: The system tablespace must be writable!
150824 14:42:58 [ERROR] Plugin 'InnoDB' init function returned error.
150824 14:42:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150824 14:42:58 [Note] Plugin 'FEEDBACK' is disabled.
150824 14:42:58 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150824 14:42:58 [ERROR] Unknown/unsupported storage engine: InnoDB
150824 14:42:58 [ERROR] Aborting
150824 14:42:58 [Note] /usr/sbin/mysqld: Shutdown complete
150824 14:42:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Das Problem mit dem Speicherplatz
Es sieht nicht so aus, als ob Speicherplatz ein Problem wäre
Antwort1
Aus diesem Grund startet es nicht:
150824 14:42:58 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
150824 14:42:58 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
Überprüfen Sie die Berechtigungen für /var/lib/mysql. Überprüfen Sie auch Ihr Systemprotokoll, um festzustellen, ob SE-Linux oder Apparmor stören.
Antwort2
Ich weiß also nicht, ob Sie dasselbe Problem hatten, und es stellte sich heraus, dass ich eine Einstellung in meiner my.cnf hatte, die beim Start nicht zutraf:
#innodb_lock_wait_timeout=1000;
Es stellte sich heraus, dass das ; einen Fehler verursachte. Das muss man sich mal vorstellen.
Antwort3
mysql
Mit den folgenden Befehlen können Sie den (insbesondere den debian 9
) starten und stoppen.
systemctl start mysql;
systemctl stop mysql;
Bei mir hat es funktioniert.