MySQL (2012, 'Error in server handshake')

Antworten
wKovacs
Beiträge: 92
Registriert: 14 Aug 2020, 12:29

MySQL (2012, 'Error in server handshake')

Beitrag von wKovacs »

Moin,

ich versuche mich gerade an einer Neuinstallation von OPSI 4.2

Zu diesem Zweck habe ich einmal Ubuntu 20.04 installiert und mich dann durch die Anleitung gearbeitet. Ich habe mich für das manuelle Setup entschieden.

Wenn ich jetzt laut Anweisung

Code: Alles auswählen

opsi-setup --configure-mysql
ausführe und erhalte ich nach dem Ausfüllen des Dialogs immer die Meldung:

Code: Alles auswählen

Failed to connect to host '127.0.0.1' as user 'root': (2012, 'Error in server handshake') 
Bisher konnte ich nicht herausfinden, was dort schief geht...

Dann habe ich Ubuntu 20.04 nochmal neu installiert und

Code: Alles auswählen

apt install opsi-server-full
ausgeführt. Dann sehe ich einige "Failed" Meldungen

Code: Alles auswählen

[4] [2021-06-26 08:34:07.759] [               ] Failed to get directories from depot: Backend configuration error: Failed to load dispatch config file '/etc/opsi/backendManager/dispatch.conf': Backend configuration error: Dispatch config file '/etc/opsi/backendManager/dispatch.conf' not found   (Rights.py:294)
[4] [2021-06-26 08:34:07.854] [               ] Failed to setup backend: "getpwnam(): name not found: 'opsiconfd'"   (setup.py:213)
[4] [2021-06-26 08:34:08.675] [               ] Failed to setup grafana: '/var/lib/grafana/plugins' not found   (setup.py:235)
[4] [2021-06-26 08:34:10.911] [               ] Faild to setup redis downsampling: Error 111 connecting to localhost:6379. Connection refused.   (setup.py:241)
[3] [2021-06-26 08:34:10.911] [               ] Failed to setup ssl: Backend configuration error: Dispatch config file '/etc/opsi/backendManager/dispatch.conf' not found   (setup.py:248)
[4] [2021-06-26 08:34:36.672] [               ] Failed to setup backend: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'opsi'@'localhost'") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (setup.py:213)
[4] [2021-06-26 08:34:37.346] [               ] Failed to get directories from depot: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'opsi'@'localhost'") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (Rights.py:294)
[4] [2021-06-26 08:34:40.505] [               ] Failed to get directories from depot: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'opsi'@'localhost'") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (Rights.py:294)
[4] [2021-06-26 08:34:41.448] [               ] Failed to get directories from depot: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'opsi'@'localhost'")
/etc/mysql/mysql.conf.d/mysqld.cnf existiert gar nicht, dabei soll dort noch ein Eintrag hinzugefügt werden

Was geht hier schief?

VG

Edit:
Ich hab jetzt nochmal von vorn mit der manuellen Installation auf einem jungfräulichen Ubuntu 20 rumgespielt.

Nach

Code: Alles auswählen

 apt install opsi-server
sehe ich wieder einiges an "Failed"-Meldungen

Code: Alles auswählen

[4] [2021-06-26 11:21:59.740] [               ] Failed to get directories from depot: Backend configuration error: Failed to load dispatch config file '/etc/opsi/backendManager/dispatch.conf': Backend configuration error: Dispatch config file '/etc/opsi/backendManager/dispatch.conf' not found   (Rights.py:294)
[3] [2021-06-26 11:22:01.313] [               ] Failed to setup ssl: Backend configuration error: Dispatch config file '/etc/opsi/backendManager/dispatch.conf' not found   (setup.py:248)
[4] [2021-06-26 11:22:04.557] [               ] Failed to setup backend: (MySQLdb._exceptions.OperationalError) (1045, "Access denied for user 'opsi'@'localhost' (using password: YES)") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (setup.py:213)
[4] [2021-06-26 11:22:05.172] [               ] Failed to get directories from depot: (MySQLdb._exceptions.OperationalError) (1045, "Access denied for user 'opsi'@'localhost' (using password: YES)") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (Rights.py:294)
[4] [2021-06-26 11:22:09.292] [               ] Failed to get directories from depot: (MySQLdb._exceptions.OperationalError) (1045, "Access denied for user 'opsi'@'localhost' (using password: YES)") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (Rights.py:294)
[4] [2021-06-26 11:22:10.245] [               ] Failed to get directories from depot: (MySQLdb._exceptions.OperationalError) (1045, "Access denied for user 'opsi'@'localhost' (using password: YES)") (Background on this error at: http://sqlalche.me/e/14/e3q8)   (Rights.py:294)
Edit 2:
Ich gab dann dem nogui quickinstall eine Chance mit folgendem Ergebnis:

Code: Alles auswählen

Please wait for the installation to start...
Installing Opsi 4.2:
Create repository...
Installing opsi-script...
Installing l-opsi-server... (This may take some minutes)

failed

You can find the log files here:
/var/log/opsi-quick-install-l-opsi-server.log
/tmp/opsi_quickinstall_nogui.log

Code: Alles auswählen

cat /var/log/opsi-quick-install-l-opsi-server.log
...
[6] [2021-06-26 12:35:00.147] []             Set  $domain$ = cat: '/var/lib/dhcp/dhclient*': No such file or directory
[2] [2021-06-26 12:35:00.147] []             Syntax Error in Section: sub "/home/asset01/opsi-quickinstall/l-opsi-server_downloaded/CLIENT_DATA/opsi42.opsiscript" (Command in line 230 in section: sub "/home/asset01/opsi-quickinstall/l-opsi-server_downloaded/CLIENT_DATA/opsi42.opsiscript"; file: opsi42.opsiscript; section start at line: 1; origin: opsi42.opsiscript; line: 230): $domain$ = cat: '/var/lib/dhcp/dhclient*': No such file or directory -> cat: '/var/lib/dhcp/dhclient*': No such file or directory illegal String Expressionstr
[6] [2021-06-26 12:35:00.147] []
[6] [2021-06-26 12:35:00.147] []           ~~~~~~ End Loop
[2] [2021-06-26 12:35:00.147] []           Syntax Error in Section: sub "/home/asset01/opsi-quickinstall/l-opsi-server_downloaded/CLIENT_DATA/opsi42.opsiscript" (Command in line 231 in section: sub "/home/asset01/opsi-quickinstall/l-opsi-server_downloaded/CLIENT_DATA/opsi42.opsiscript"; file: opsi42.opsiscript; section start at line: 1; origin: opsi42.opsiscript; line: 231): EndIf -> expected
[6] [2021-06-26 12:35:00.147] []
[6] [2021-06-26 12:35:00.148] []   ~~~~~~~ End Sub   ~~~~~~~  sub "/home/asset01/opsi-quickinstall/l-opsi-server_downloaded/CLIENT_DATA/opsi42.opsiscript"
[6] [2021-06-26 12:35:00.148] []
[2] [2021-06-26 12:35:00.148] []   Syntax Error in Section: Actions (Command in line 44 in section: Actions; file: setup.opsiscript; section start at line: 6; origin: setup.opsiscript; line: 44): EndIf -> expected
[1] [2021-06-26 12:35:00.148] [] ___________________
[1] [2021-06-26 12:35:00.148] [] script finished: failed
[1] [2021-06-26 12:35:00.148] [] 3 errors
[1] [2021-06-26 12:35:00.148] [] 0 warnings
...
Benutzeravatar
j.schneider
uib-Team
Beiträge: 1789
Registriert: 29 Mai 2008, 15:14

Re: MySQL (2012, 'Error in server handshake')

Beitrag von j.schneider »

Hallo,

die Fehlermeldungen nach

Code: Alles auswählen

apt install opsi-server-full
können ignoriert werden.
Bitte einfach weiter der Anleitung folgen.

https://download.uib.de/opsi4.2/documen ... ion-config
wKovacs
Beiträge: 92
Registriert: 14 Aug 2020, 12:29

Re: MySQL (2012, 'Error in server handshake')

Beitrag von wKovacs »

Moin,

ich habe heute noch einmal Ubuntu 20.04 neu aufgesetzt und mich durch die Anleitung gehangelt.

Sobald ich

Code: Alles auswählen

opsi-setup --configure-mysql
ausführe grüßt mich folgende Fehlermeldung: Bild

Damit komm ich an dieser Stelle nicht weiter.

VG

wKovacs
Benutzeravatar
fkalweit
uib-Team
Beiträge: 173
Registriert: 23 Okt 2020, 16:14

Re: MySQL (2012, 'Error in server handshake')

Beitrag von fkalweit »

Hallo,

funktioniert es evt mit "localhost" statt 127.0.0.1? Welche Authentication Plugin wird denn für root verwendet?

Code: Alles auswählen

SELECT user, plugin, host FROM mysql.user;
Gruß
fkalweit
wKovacs
Beiträge: 92
Registriert: 14 Aug 2020, 12:29

Re: MySQL (2012, 'Error in server handshake')

Beitrag von wKovacs »

Moin,

da ich weiter experimentiert hatte, habe heute nochmal eine Installation von vorn begonnen (2mal um genau zu sein) und diesmal konnte ich opsi-setup --configure-mysql ohne Probleme abschliessen (beide male).
DirKah
Beiträge: 1
Registriert: 23 Sep 2021, 17:09

Re: MySQL (2012, 'Error in server handshake')

Beitrag von DirKah »

Moin,

ich habe das gleiche Problem auf einem frisch aufgesetztem Ubuntu 20.04 und ich kann es leider durch erneute Installationen nicht beseitigen.

apt update
apt install redis-server redis-timeseries grafana mysql-server
systemctl daemon-reload
systemctl enable grafana-server
systemctl start grafana-server
apt install opsi-server
apt install opsi-windows-support

Die Installationen laufen soweit durch, außer redis-timeseries, dieses Paket ist nicht im Repo vorhanden und auch auch nicht installiert.

Dann führe ich das opsi-setup aus:
opsi-setup --configure-mysql

und bekomme einen 2012 handsheke Fehler egal vom mit IP oder localhost.

Hat einer eine Idee wie ich weiter vorgehen kann?
Im /var/log/mysql/error.log steht nicht drin.
MfG
Dirk Kahlen
Eric.Giesi
Beiträge: 5
Registriert: 29 Apr 2022, 10:23

Re: MySQL (2012, 'Error in server handshake')

Beitrag von Eric.Giesi »

Hallo,

sind ebenfalls in den genannten Fehler gelaufen:

Code: Alles auswählen

opsi Failed to connect to host '127.0.0.1' as user 'root': (2012, 'Error in  server handshake')
Lösung:
1.) in MySQL einloggen:

Code: Alles auswählen

sudo mysql -u root -p
2.) Passwort aktualisieren:

Code: Alles auswählen

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
fertig

Code: Alles auswählen

sudo opsi-setup --configure-mysql
wirft nun keinen Fehler mehr.

Gruß
Eric
Antworten