Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| datenbanken:mysql [2022/10/03 18:54] – [Backup] st | datenbanken:mysql [2024/07/16 17:09] (aktuell) – [MySQL 8.4 mysql_native_password und ansible] st | ||
|---|---|---|---|
| Zeile 127: | Zeile 127: | ||
| + | ==== Verschlüsselung ==== | ||
| + | MySql kann ssl-Verschlüsselung, | ||
| + | <code bash> | ||
| + | |||
| + | my.cnf: | ||
| + | < | ||
| + | ssl-cert = / | ||
| + | ssl-key = / | ||
| + | </ | ||
| + | |||
| + | Andere Fehlerquellen: | ||
| ==== Konfigurationsparamter tunen ==== | ==== Konfigurationsparamter tunen ==== | ||
| Zeile 333: | Zeile 344: | ||
| SQL-Befehle zum anlegen eines neuen Benutzers user1 mit dem passwort " | SQL-Befehle zum anlegen eines neuen Benutzers user1 mit dem passwort " | ||
| - | <file> | + | <code sql> |
| CREATE USER ' | CREATE USER ' | ||
| GRANT USAGE ON *.* TO ' | GRANT USAGE ON *.* TO ' | ||
| Zeile 340: | Zeile 351: | ||
| GRANT ALL PRIVILEGES ON `db1`.* TO ' | GRANT ALL PRIVILEGES ON `db1`.* TO ' | ||
| - | </file> | + | </code> |
| === Benutzer löschen === | === Benutzer löschen === | ||
| Zeile 357: | Zeile 368: | ||
| === Passwort Ändern === | === Passwort Ändern === | ||
| - | <code bash> | + | * Alte Datenbanken: |
| use mysql; | use mysql; | ||
| update user set password=PASSWORD(" | update user set password=PASSWORD(" | ||
| + | flush privileges; | ||
| + | quit | ||
| </ | </ | ||
| - | + | * ab Version 5.7.x: <code bash> | |
| - | ab Version 5.7.x: | + | |
| - | <code bash> | + | |
| use mysql; | use mysql; | ||
| update user set authentication_string=PASSWORD(" | update user set authentication_string=PASSWORD(" | ||
| + | flush privileges; | ||
| + | quit | ||
| </ | </ | ||
| - | + | * ab MariaDB-10.4+ (mysql.user ist eine View und keine Table mehr [[https:// | |
| - | <code bash> | + | SET PASSWORD FOR ' |
| flush privileges; | flush privileges; | ||
| quit | quit | ||
| </ | </ | ||
| - | |||
| - | |||
| === Rechte eines Benutzers === | === Rechte eines Benutzers === | ||
| Zeile 482: | Zeile 493: | ||
| show_compatibility_56 | show_compatibility_56 | ||
| </ | </ | ||
| + | |||
| + | ==== MySQL 8.4 mysql_native_password und ansible ==== | ||
| + | |||
| + | MySQL 8.4 lädt standardmäßig kein mysql_native_password mehr (Fehlermeldung: | ||
| + | Nachfolger: caching_sha2_password (PHP unterstützt das seit 7.4). | ||
| + | |||
| + | siehe auch: https:// | ||
| + | |||
| + | statt | ||
| + | <code yaml> | ||
| + | community.mysql.mysql_user: | ||
| + | password: ' | ||
| + | </ | ||
| + | also | ||
| + | <code yaml> | ||
| + | community.mysql.mysql_user: | ||
| + | password: ' | ||
| + | encrypted: true | ||
| + | </ | ||
| ===== MySQL interna ===== | ===== MySQL interna ===== | ||