Fehlermeldung / kann mich nicht in phpmyadmin einloggen (your password has expired?)

cabriofahrer

Well-Known Member
Ich habe auf dem Laptop (FreeBSD i386-12.0) Apache, php, mysql und phpmyadmin installiert und dabei folgende Anleitung befolgt:

https://www.iceflatline.com/2011/11/how-to-install-apache-mysql-php-and-phpmyadmin-on-freebsd/

Die Anleitung ist alt, hat aber vor nichtmal einem Jahr auf meinem Hauptrechner zum Erfolg geführt, wobei ich mich nicht mehr genau erinnern kann, was ich letztendlich genau gemacht hatte. Natürlich muss man auf die neuesten Versionen achten, wie z.B php73. Da z.Zt. für mysql die Version 5.7 default ist, habe ich eben diese installiert.

Allerdings habe ich, und ich glaube, dass darin der Fehler liegen könnte, anstatt wie hier beschrieben

mysql.png


nicht die letzten beiden Schritte befolgt, sondern stattdessen, wie ei zwei anderen Anleitungen beschrieben, den Befehl

Code:
#mysql_secure_installation

ausgeführt, mit dem man ja auch nach einem Passwort für root gefragt wird, welches ich auch festgelegt habe.

Weiterhin habe ich die neueste Version von phpmyadmin installiert und die Anleitung bis fast zum Schluss befolgt, doch

Code:
Now open your web browser and navigate to http://your-hostname-or-IP-address/phpmyadmin/setup where you will see the phpMyAdmin setup Overview page.

Code:
localhost/phpmyadmin/setup

klappt nicht:

Screenshot_2019-09-21_16-31-34.png

Und wenn ich direkt auf localhost/phpmyadmin gehe, dann:

Screenshot_2019-09-21_14-29-53.png


Expired? Ich habe doch gerade neu eingerichtet mit

Code:
#mysql_secure_installation
 
Ich würds auch erstmal auf der CLI probieren. Wenn es da klappt schau mal ins Log vom Webserver, bzw. das PHP Log.
 
CLI klappt:

Code:
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27-log

Copyright (c) 2000, 2019, 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.

root@localhost [(none)]>

Weiß nicht, ob Ihr das hier meint:

Code:
$ tail -50 /var/log/httpd-access.log
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.event.drag-2.2.js?v=4.9.0.1 HTTP/1.1" 200 12826
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/js.cookie.js?v=4.9.0.1 HTTP/1.1" 200 3886
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.validate.js?v=4.9.0.1 HTTP/1.1" 200 48696
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/cross_framing_protection.js?v=4.9.0.1 HTTP/1.1" 200 471
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/doclinks.js?v=4.9.0.1 HTTP/1.1" 200 20643
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/keyhandler.js?v=4.9.0.1 HTTP/1.1" 200 3333
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery-ui-timepicker-addon.js?v=4.9.0.1 HTTP/1.1" 200 78475
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/rte.js?v=4.9.0.1 HTTP/1.1" 200 47688
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/tracekit.js?v=4.9.0.1 HTTP/1.1" 200 45389
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/shortcuts_handler.js?v=4.9.0.1 HTTP/1.1" 200 3264
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/addon/lint/lint.js?v=4.9.0.1 HTTP/1.1" 200 8609
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.debounce-1.0.5.js?v=4.9.0.1 HTTP/1.1" 200 1169
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/navigation.js?v=4.9.0.1 HTTP/1.1" 200 59988
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/messages.php?l=en&v=4.9.0.1&lang=en HTTP/1.1" 200 8837
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/common.js?v=4.9.0.1 HTTP/1.1" 200 19196
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.min.js?v=4.9.0.1 HTTP/1.1" 200 86927
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/addon/hint/show-hint.js?v=4.9.0.1 HTTP/1.1" 200 15909
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/functions.js?v=4.9.0.1 HTTP/1.1" 200 175177
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/themes/dot.gif HTTP/1.1" 200 43
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/mode/sql/sql.js?v=4.9.0.1 HTTP/1.1" 200 45323
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/console.js?v=4.9.0.1 HTTP/1.1" 200 57280
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/addon/hint/sql-hint.js?v=4.9.0.1 HTTP/1.1" 200 9148
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/themes/pmahomme/img/logo_right.png HTTP/1.1" 200 4306
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/whitelist.php?v=4.9.0.1&lang=en HTTP/1.1" 200 491
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.mousewheel.js?v=4.9.0.1 HTTP/1.1" 200 8267
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/addon/runmode/runmode.js?v=4.9.0.1 HTTP/1.1" 200 2499
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/menu-resizer.js?v=4.9.0.1 HTTP/1.1" 200 8318
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/config.js?v=4.9.0.1 HTTP/1.1" 200 27526
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/phpmyadmin.css.php?nocache=4703716558ltr&server=1 HTTP/1.1" 200 20812
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/page_settings.js?v=4.9.0.1 HTTP/1.1" 200 1749
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/addon/hint/sql-hint.js?v=4.9.0.1 HTTP/1.1" 200 9148
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/config.js?v=4.9.0.1 HTTP/1.1" 200 27526
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/page_settings.js?v=4.9.0.1 HTTP/1.1" 200 1749
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/indexes.js?v=4.9.0.1 HTTP/1.1" 200 27654
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/error_report.js?v=4.9.0.1 HTTP/1.1" 200 10837
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery-ui.min.js?v=4.9.0.1 HTTP/1.1" 200 253681
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/lib/codemirror.js?v=4.9.0.1 HTTP/1.1" 200 373234
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.ba-hashchange-1.3.js?v=4.9.0.1 HTTP/1.1" 200 16522
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/codemirror/addon/lint/sql-lint.js?v=4.9.0.1 HTTP/1.1" 200 1048
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/codemirror/addon/lint/sql-lint.js?v=4.9.0.1 HTTP/1.1" 200 1048
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/jquery/jquery.ba-hashchange-1.3.js?v=4.9.0.1 HTTP/1.1" 200 16522
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/error_report.js?v=4.9.0.1 HTTP/1.1" 200 10837
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/indexes.js?v=4.9.0.1 HTTP/1.1" 200 27654
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/js/vendor/codemirror/addon/runmode/runmode.js?v=4.9.0.1 HTTP/1.1" 200 2499
127.0.0.1 - - [22/Sep/2019:18:15:17 +0200] "GET /phpmyadmin/themes/pmahomme/img/logo_right.png HTTP/1.1" 200 4306
127.0.0.1 - - [22/Sep/2019:18:15:18 +0200] "GET /phpmyadmin/themes/pmahomme/img/b_help.png HTTP/1.1" 200 705
127.0.0.1 - - [22/Sep/2019:18:15:31 +0200] "POST /phpmyadmin/index.php HTTP/1.1" 200 3592
127.0.0.1 - - [22/Sep/2019:18:15:31 +0200] "GET /phpmyadmin/js/whitelist.php?v=4.9.0.1 HTTP/1.1" 200 491
127.0.0.1 - - [22/Sep/2019:18:15:31 +0200] "GET /phpmyadmin/js/messages.php?l=en&v=4.9.0.1 HTTP/1.1" 200 8837
127.0.0.1 - - [22/Sep/2019:18:15:31 +0200] "GET /phpmyadmin/themes/pmahomme/img/s_error.png HTTP/1.1" 200 614
$

und

Code:
$ tail -20 /var/log/httpd-error.log
[Fri Sep 20 17:23:56.720689 2019] [core:notice] [pid 1479] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Sep 20 19:27:42.632503 2019] [mpm_prefork:notice] [pid 1479] AH00169: caught SIGTERM, shutting down
[Fri Sep 20 19:27:43.018994 2019] [mpm_prefork:notice] [pid 2540] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Fri Sep 20 19:27:43.019135 2019] [core:notice] [pid 2540] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Sep 20 19:34:18.251908 2019] [mpm_prefork:notice] [pid 2540] AH00169: caught SIGTERM, shutting down
[Fri Sep 20 19:39:02.597845 2019] [mpm_prefork:notice] [pid 2039] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Fri Sep 20 19:39:02.598721 2019] [core:notice] [pid 2039] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Sep 20 19:54:04.786632 2019] [mpm_prefork:notice] [pid 2039] AH00169: caught SIGTERM, shutting down
[Sat Sep 21 14:11:20.801140 2019] [mpm_prefork:notice] [pid 2025] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Sat Sep 21 14:11:20.801574 2019] [core:notice] [pid 2025] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Sat Sep 21 15:02:27.128263 2019] [mpm_prefork:notice] [pid 1448] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Sat Sep 21 15:02:27.129070 2019] [core:notice] [pid 1448] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Sat Sep 21 15:04:28.831400 2019] [mpm_prefork:notice] [pid 1448] AH00169: caught SIGTERM, shutting down
[Sat Sep 21 15:54:16.358752 2019] [mpm_prefork:notice] [pid 2065] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Sat Sep 21 15:54:16.359606 2019] [core:notice] [pid 2065] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Sat Sep 21 16:29:27.998953 2019] [mpm_prefork:notice] [pid 1437] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Sat Sep 21 16:29:28.004010 2019] [core:notice] [pid 1437] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Sat Sep 21 16:38:30.548120 2019] [mpm_prefork:notice] [pid 1437] AH00169: caught SIGTERM, shutting down
[Sun Sep 22 18:08:56.647449 2019] [mpm_prefork:notice] [pid 2084] AH00163: Apache/2.4.41 (FreeBSD) PHP/7.3.9 configured -- resuming normal operations
[Sun Sep 22 18:08:56.648002 2019] [core:notice] [pid 2084] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
$

Könnt Ihr damit etwas anfangen? Die Fehlermeldung besagt ja, dass mein Passwort abgelaufen ist und dass ich mit einem Client, der abgelaufene Passwörte unterstützt, dieses ändern soll. Wie könnte ich das mit dem CLI denn hinkriegen?

Moment, Nachtrag: Zwar konnte ich mich einloggen, aber:

Code:
root@localhost [(none)]> create database testdb1;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
root@localhost [(none)]>

Also scheinbar in der CLI das gleiche Problem. Wie geht das ALTER USER statement?
 
alter user 'root'@'localhost' identified by "newPassword";

flush privileges;


aufpassen das du womöglich mehrere root@ user hast mit root@127.0.0.1 oder auch root@hostname.localdomain.

Nachtrag zu den Logs: Dein php sollte normal ein eigenes errorlog schreiben. Das wäre interessant.
 
Wenn ich mich recht erinnere, ist ein root login bei phpMyAdmin nach einem "mysql_secure_installation" auch Sicherheitsgruenden nicht moeglich. Du solltest dich am besten von der cli aus als root in mysql anmelden und einen user erstellen. Mit dem sollte dann der login moeglich sein.
 
Normal irgendwo unter /var/log, aber der genaue Pfad wird meines wissens in der php.ini gesetzt.
Die Anleitung, die @cabriofahrer verwendet hat, bindet PHP als mod_php in den Apache ein. Dann gibt es kein eigenes PHP-Log, sondern alles findet sich im Apache-Error-Log. Nur wenn man PHP als eigenen Service (php-fpm) laufen lässt, bekommt man ein eigenes Log - standardmäßig unter /var/log/php-fpm.log.
 
Die Anleitung, die @cabriofahrer verwendet hat, bindet PHP als mod_php in den Apache ein. Dann gibt es kein eigenes PHP-Log, sondern alles findet sich im Apache-Error-Log. Nur wenn man PHP als eigenen Service (php-fpm) laufen lässt, bekommt man ein eigenes Log - standardmäßig unter /var/log/php-fpm.log.

Das wusste ich nicht, ich verwende auch nur fpm. Was uns zu veralteten HowTos bringt, sogar Apache rät von mod_php ab. Aber auch so muss in den Logs was stehen, ist vielleicht ein zu niedrigens Logleven gesetzt? Ohne Logs ists halt Raten.

@cabriofahrer Hast du schon das 'root'@'localhost' Passwort neu gesetzt? Auch 'root'@'127.0.0.1'?

@midnight Ich habs nicht für alle Systeme im Kopf aber bei Linux muss man nur ein root Passwort setzen und er unterbindet root von remote Adressen.
 
@cabriofahrer Hast du schon das 'root'@'localhost' Passwort neu gesetzt? Auch 'root'@'127.0.0.1'?

Ja, jetzt gerade hatte ich Zeit, das war's, Volltreffer, Danke! Aber auch 'root'@'127.0.0.1'? Verstehe ich nicht, 127.0.0.1 ist doch das Gleiche wie localhost?

Ich habe jetzt aber noch ein paar Verständnisfragen:

alter user 'root'@'localhost' identified by "newPassword";

und davor
Code:
mysql -u root -p
stehen ja auch in der Anleitung, also hätte ich diese strikt befolgt und nicht ein

Code:
mysql_secure_installation
gemacht, wäre das Problem wohl auch nicht aufgetreten.

Wenn ich mich recht erinnere, ist ein root login bei phpMyAdmin nach einem "mysql_secure_installation" auch Sicherheitsgruenden nicht moeglich.

Finde ich einen wichtigen Hinweis. Ist denn dann "mysql_secure_installation" überhaupt kein zwingend notwendiger Schritt für die Einrichtung von mysql?

Ist "mysql -u root -p" und anschließend

alter user 'root'@'localhost' identified by "newPassword";

dann also alles, was man braucht? Und warum ist letzteres überhaupt nötig, wenn "mysql -u root -p" beim ersten Mal die Festlegung eines Passwortes verlangt?

Und dann noch zu der Konfiguration von phpmyadmin selbst:

Screenshot_2019-09-23_19-50-23.png


Wieso bekam ich die weiter oben abgebildete Fehlermeldung, "Configuration already exists, setup is diabled?"
 
Ja, jetzt gerade hatte ich Zeit, das war's, Volltreffer, Danke! Aber auch 'root'@'127.0.0.1'? Verstehe ich nicht, 127.0.0.1 ist doch das Gleiche wie localhost?

Mysql legt da 2 User an, localhost MUSS ja auch nicht zwingend auf 127.0.0.1 zeigen. Siehe

> select * from mysql.user where user="root" \G

Ich habe jetzt aber noch ein paar Verständnisfragen:



und davor
Code:
mysql -u root -p
stehen ja auch in der Anleitung, also hätte ich diese strikt befolgt und nicht ein

Code:
mysql_secure_installation
gemacht, wäre das Problem wohl auch nicht aufgetreten.



Finde ich einen wichtigen Hinweis. Ist denn dann "mysql_secure_installation" überhaupt kein zwingend notwendiger Schritt für die Einrichtung von mysql?

Ist "mysql -u root -p" und anschließend

alter user 'root'@'localhost' identified by "newPassword";

dann also alles, was man braucht? Und warum ist letzteres überhaupt nötig, wenn "mysql -u root -p" beim ersten Mal die Festlegung eines Passwortes verlangt?

Normal verlangt MySQL kein setzten des Root-PWs. Was genau da bei dir schief lief kann ich nicht sagen. mysql_secure_installation macht noch etwas mehr als nur das root-pw zu setzen, es löscht z.b. auch die test-tables aus der DB. Da man in der Regel sowieso ein Root-PW setzen möchte, schadet als also nich es auszuführen. Letzteres geht damit auch etwas bequemer (wenn es denn funktioniert).

Und dann noch zu der Konfiguration von phpmyadmin selbst:

Anhang anzeigen 3896

Wieso bekam ich die weiter oben abgebildete Fehlermeldung, "Configuration already exists, setup is diabled?"

Mit phpMYAdmin kenn ich mich nicht wirklich aus, aber eine Anleitung die empfiehlt ein config-dir unter dem apache web-root auf o+w zu setzen wäre mir sehr suspekt. Wenn das so ins Web soll würde ich mir da auf jedenfall nochmal gedanken drüber machen.
 
Zurück
Oben