• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[gelöst] MySQL 8.0 Rootpasswort lässt sich nicht ändern

daddy.k

Member
Hallo alle zusammen,

ich habe mir jetzt ganz neu MySQL 8 auf Leap 15 installiert.

Nach dem ich mir mit
Code:
grep 'temporary password' /var/log/mysql/mysqld.log
das Passwort geholt habe, kann ich mich auch anmelden.
Weiter komme ich allerdings nicht mehr.

Die Abfrage nach dem Status wird wie folgt beantwortet.
Code:
mysql> status;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

Folge ich dem "MySQL 8.0 Reference Manual" erhalte ich folgende Anweisung.
Code:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Auch Versuche mit
Code:
mysql> ALTER USER 'root'@'localhost' INDETIFIED BY PASSWORD('roland2012');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDETIFIED BY PASSWORD('roland2012')' at line 1
oder
Code:
mysql> ALTER USER 'root'@'localhost' INDENTIFIED BY PASSWORD 'roland2012';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED BY PASSWORD 'roland2012'' at line 1
sind nicht wirklich effektiv.

Aufgefallen ist mir, dass die Datei "/etc/my.cnf" total anders aussieht wie meine alten Versionen
Code:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysql/mysqld.log
pid-file=/var/run/mysql/mysqld.pid
my.cnf lines 1-30/30 (END)

auch der Ordner "my.cnf.d/" ist leer im gegensatz zu Mysql 5.7.
Code:
server0:/etc # cd my.cnf.d/
server0:/etc/my.cnf.d # dir
total 0
server0:/etc/my.cnf.d #

Bestimmt kann mir jemand sagen, wie ich weiter vorgehen kann um MySQL 8.0 zu nutzen und
wie wird MySQL 8.0 konfiguriert?

Das Manual auf deutsch wäre für mich sehr hilfreich und einfacher.

Schöne Grüße
daddy.k
 
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
ist doch relativ eindeutig. Dein Passwort entspricht nicht den von MySQL gewünschten Anforderungen. Ich weiß nicht wie die derzeit aussehen aber Du solltest es mal mit einem komplexeren Passwort versuchen. Alternativ kannst Du mit der Suchmaschine deines geringsten Mißtrauens mal gucken ob man diese policy ändern/abschalten kann.
 
OP
D

daddy.k

Member
Hallo alle zusammen,
die vielleicht einmal wie ich vor diesem Problem stehen, hier die Auflösung. (sehr simpel)

Hallo Geier0815, dein Hinweis alleine war nicht die Lösung, trotzdem vielen Dank.

Um den 'Root'- Zugriff auf MySQL 8.0 zu aktivieren holt man sich mit
Code:
grep 'temporary password' /var/log/mysql/mysqld.log
2018-06-04T20:58:20.687653Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: y2BCUdrdAA%X
wie hier in meinem Fall das Root-Passwort, das MySQL 8.0 bei der Installation im LOG-File ablegt hat.

im 2. Schritt Logt man sich mit diesem Passwort in MySQL ein, ein "mysqladmin -u root password 'xxx'" funktioniert nicht.
Code:
mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.11

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

an diesem Punkt ist weder "show databases;" noch "use mysql;" erlaubt.
Ein vielleicht wichtiger hinweis: Schreiben Sie ALLE Datenbankbefehle groß.
Da ich gerne einmal auch die Datenbankbefehle kleinschreibe bekommen Sie folgende Info:
Code:
mysql> alter user 'root' identified by 'y2BCUdrdAA%X';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

Die richtige Schreibweise lautet also wie folgt:
Code:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'y2BCUdrdAA%X';
Query OK, 0 rows affected (0.03 sec)

ab jetzt steht Ihnen MySQL 8.0 zu diensten, und es können auch wieder alle Befehle klein geschrieben werden.

Vielleicht noch wichtig:
Für die Passwörter möchte MySQL 8.0 grundsätzlich einen Großbuchstaben, ein Sonderzeichen und eine Zahl!

Vielen Dank an alle, die sich gedanken darüber gemacht haben

Gruß
Daddy.k





Ändern Sie jetzt das Root-Passwort mit
Code:
 
Oben