Lästiges MySQL Problem

unknownCH

New Member
Hallo zusammen,

ich hab einen Debian Server am laufen, welcher (zur Erleichterung) mit Plesk läuft, da ich keine riesigen Projekte betreibe und mich nur mit dem wo ich wissen muss jeweils beschäftige. Bei Problemen google ich jedesmal nach den Fehlern und kam dadurch in den vergangenen Jahren immer zu Lösungen =) Jetzt aber komm ich leider nicht weiter und möchte gerne euch um Rat fragen. Seit einem Update auf MySQL 5.6 vor einiger Zeit hat sich das SQL ziemlich verschossen, wenn ich es starten möchte gehts nicht, bei einem Server-Neustart läuft es etwa 1 Minute, danach stürzt es ab.

Im Log taucht folgendes auf:

150328 12:21:00 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
2015-03-28 12:21:19 1655 [Note] Plugin 'FEDERATED' is disabled.
2015-03-28 12:21:19 1655 [ERROR] Function 'innodb' already exists
2015-03-28 12:21:19 1655 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-03-28 12:21:19 1655 [ERROR] Function 'federated' already exists
2015-03-28 12:21:19 1655 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-03-28 12:21:19 1655 [ERROR] Function 'blackhole' already exists
2015-03-28 12:21:19 1655 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-03-28 12:21:19 1655 [ERROR] Function 'archive' already exists
2015-03-28 12:21:19 1655 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-03-28 12:21:19 1655 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-03-28 12:21:19 1655 [Note] InnoDB: The InnoDB memory heap is disabled
2015-03-28 12:21:19 1655 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-03-28 12:21:19 1655 [Note] InnoDB: Memory barrier is not used
2015-03-28 12:21:19 1655 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-03-28 12:21:19 1655 [Note] InnoDB: Using Linux native AIO
2015-03-28 12:21:19 1655 [Note] InnoDB: Using CPU crc32 instructions
2015-03-28 12:21:19 1655 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-03-28 12:21:19 1655 [Note] InnoDB: Completed initialization of buffer pool
2015-03-28 12:21:19 1655 [Note] InnoDB: Highest supported file format is Barracuda.
150328 12:21:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-03-28 12:21:19 1655 [Note] InnoDB: 128 rollback segment(s) are active.
2015-03-28 12:21:19 1655 [Note] InnoDB: Waiting for purge to start
2015-03-28 12:21:19 1655 [Note] InnoDB: 5.6.23 started; log sequence number 69903061
2015-03-28 12:21:19 1655 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2015-03-28 12:21:19 1655 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2015-03-28 12:21:19 1655 [Note] Server socket created on IP: '127.0.0.1'.
2015-03-28 12:21:19 1655 [Note] Event Scheduler: Loaded 0 events
2015-03-28 12:21:19 1655 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.23-1~dotdeb.3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Debian)
2015-03-28 12:21:19 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-03-28 12:21:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-03-28 12:21:19 2227 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2015-03-28 12:21:19 2227 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2015-03-28 12:21:19 2227 [Note] Plugin 'FEDERATED' is disabled.
2015-03-28 12:21:19 2227 [ERROR] Function 'innodb' already exists

Google liefert verschiedene Lösungsvorschläge, unter anderem folgende habe ich ausprobiert:

innodb_buffer_pool_size=4G
innodb_buffer_pool_instances=2
innodb_read_io_threads=12
innodb_write_io_threads=12
innodb_io_capacity=300
innodb_log_file_size=128M

Wasn't sure if there should be anything else INNODB related. Based on what I could find also added

innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 1
innodb_file_per_table = 1

Keiner davon hat funktioniert :( Vermutlich ist die Lösung total einfach, aber sie steht nirgendwo :(
Manche Lösungen empfahlen, MySQL neu zu installieren, brachte aber auch nichts.

root@XXXXX:~# apt-get --reinstall install mysql-server-core-5.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/7237 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 126222 files and directories currently installed.)
Preparing to replace mysql-server-core-5.6 5.6.23-1~dotdeb.3 (using .../mysql-server-core-5.6_5.6.23-1~dotdeb.3_amd64.deb) ...
Unpacking replacement mysql-server-core-5.6 ...

root@XXXX:~# /etc/init.d/mysql start
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!

Hat noch jemand von euch eine Idee wie ich das lösen könnte oder näher herausfinden was genau die Ursache ist?

Hier noch die my.cnf, falls relevant:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/serve ... ables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[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
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#slow_query_log = 1
#slow_query_log_file = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

Lg
 
Augenscheinlich hat sich beim Update von 5.1 auf 5.6 etwas an der Pluginverwaltung geändert.

Prinzipiell beziehen sich die Logzeilen beginnend mit 'ERROR' auf zu ladende Plugins. Mysql bietet dazu 2 Konfigurationsvarianten an, entweder man lädt das Plugin über die my.cnf (da sehe ich aber nichts Auffälliges) oder schreibt den Namen in die Systemtabelle mysql.plugins

Bei Dir ist vermutlich zweiteres der Fall. Bitte poste mal den Output von
Code:
select * from mysql.plugins;

Gruss

[1] http://forums.mysql.com/read.php?22,614511,614601#msg-614601
 
Hallo,

überprüf mal die /etc/passwd ob das Homedir für den MySQL-Benutzer auf /var/lib/mysql gesetzt ist.
 
Schau mal in /etc/mysql/conf.d/ nach, ob da eine Konfig-Datei für innodb drin liegt und entferne diese (z.B. ins Home-Verzeichnis verschieben) - es kann sein, dass er da versucht, innodb noch mal zu laden, obwohl es bei MySQL 5.6 standardmäßig geladen wird (wenn ich das richtig im Kopf habe)
 
Sorry für die späte Antwort (war beruflich nicht zuhause) und danke für eure Tipps :) weiss das sehr zu schätzen :)



@kannix: Sorry für die dumme Nachfrage, aber wo genau geb ich das ein? :( via Konsole?!
root@lxxx~# select * from mysql.plugins;
-bash: syntax error near unexpected token `from'
root@xxxx:~# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@xxxxx:~# mysqld
2015-04-05 13:59:50 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-04-05 13:59:50 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

@bibau: in der /etc/passwd steht
mysql:x:103:108:MySQL Server,,,:/var/lib/mysql:/bin/false
Ist das so korrekt?

@danton, in dem Ordner steht eine my5.6.cnf und mysqld_safe_syslog.cnf, in ersteres ist alles auskommentiert, in der anderen steht nur mysqldsave & syslog.
 
Habe heute nochmal 1 Stunde damit verbracht und komme einfach nicht weiter...
Wenn man mal nach mySQL 5.6 [ERROR] Function 'innodb' already exists googelt, haben viele dieses Problem (der Thread kommt auch auf Seite1 der Ergebnisse) aber nirgendwo gibt es eine Lösung ...

Da steht etwas: http://forums.mysql.com/read.php?22,614511,614534

Aber ich verstehe die "Lösung" paar Posts später nicht ganz, die Plugin Abfrage geht ja nur wenn MySQL läuft?! Was genau löscht er da? http://forums.mysql.com/read.php?22,614511,614615#msg-614615

Finde auf dem Server auch keine innodb ha_innodb.so via locate.

Bin auch sehr gerne bereit, jemanden wo sich dem Problem annimmt und auf dem Server anschaut eine faire Aufwandsentschädigung zu bezahlen, je nach Aufwand. Bei freiwilliger Hilfe sonst gerne eine kleine Spende via Paypal oder zB Bestellung aus nem Amazon Wunschzettel :) Habe zwar nicht unendlich Geld (kann also keine 500 Euro oder so zahlen..) aber das Problem muss echt behoben werden :(
Habe auch versucht zu finden wie ich MySQL zurück auf Version 5.5 setze aber dann zickt Plesk und will sich mit deinstallieren bei apt-get :(

Lg
 
Der Hoster hets nun ohne Zusatzkosten behoben, echt nett von Ihnen - zumal es Server4You ist, wo ja aufgrund der Preise keinen so guten Support bieten kann normalerweise.

Wer das Problem ebenfalls hat, evtl. könnt Ihr damit etwas anfangen :)

-->
/var/lib/mysql# mv ibdata1 ibdata1_bak
/var/lib/mysql# cp -a ibdata1_bak ibdata1
/var/lib/mysql# service mysql restart
mysql start/running, process 16008

root@xxxx:/var/lib/mysql# mysql -uadmin -p`cat /etc/psa/.psa.shadow`
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 216
Server version: 5.6.23-1~dotdeb.3 (Debian)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> quit
Bye
<--


Cheers
 
Das weiss ich auch nicht, auf jedenfall funktioniert es nun. Nach nem Reboot ist der DB-Server zwar wieder mitdemselben Symptom, aber mit den 2 Befehlen klappts.

Vermutlich haben die noch in irgendeinem anderen Log etwas gesehen wo den Fehler auslöst... Wenn irgendein anderer via Google den Thread hier findet und damit gelöst bekommt wirds Ihm egal sein ;o)
 
Ich hoffe vor dem mv gab es wenigstens ein mysql stop, ansonnsten hast du ein schweine Glück gehabt wenn es dir nicht die InnoDB Indexe zerschossen hat.
 
Das weiss ich auch nicht, auf jedenfall funktioniert es nun.
Nein, tut es nicht. Definitiv nicht.

Nach nem Reboot ist der DB-Server zwar wieder mitdemselben Symptom
Ach!?!
Wie kommst Du dann dazu das Problem als gelöst zu betrachten?
Und propagierst hier eine vogebliche Lösung obwohl Du genau weisst. dass sie keine Lösung ist?


Naja, mir egal, zerschiess Dir Deine Daten ruhig aber heul anschliessend nicht rum, Du wurdest ausreichend gewarnt.


BTW: Die Lösung ist soetwas von simple, dass man niemals darauf kommen wird: Eine saubere Installation.
 
Back
Top