Jump to content
Froxlor Forum
  • 0

Fresh Install Debian 11


Akecheta

Question

Hallo, 

ich habe gerade eine Debian 11 Maschiene aufgesetzt da ich die Kisten von einem Hoster zum anderen umziehen wollte, leider habe ich aber nun ein Problem mit der installation und hoffe das mir hier einer helfen könnte.

System.: Debian 11 (Bullseye)
MySQL.:  mariadb-server-10.5 (1:10.5.12-0+deb11u1)
Webserver.: Apache2 + php8.1.3

Fehleranzeige musste ich aktivieren damit mir der fehler angezeigt wird. Dabei kam dann diese meldung...

Zitat

Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY '<<Passwort vom Froxloruser>>'' at line 1 in /www/froxlor/install/lib/class.FroxlorInstall.php:744 Stack trace: #0 /www/froxlor/install/lib/class.FroxlorInstall.php(744): PDOStatement->execute() #1 /www/froxlor/install/lib/class.FroxlorInstall.php(725): FroxlorInstall->_grantDbPrivilegesTo() #2 /www/froxlor/install/lib/class.FroxlorInstall.php(260): FroxlorInstall->_createDatabaseAndUser() #3 /www/froxlor/install/lib/class.FroxlorInstall.php(127): FroxlorInstall->_doInstall() #4 /www/froxlor/install/lib/class.FroxlorInstall.php(111): FroxlorInstall->_showPage() #5 /www/froxlor/install/install.php(30): FroxlorInstall->run() #6 {main} thrown in /www/froxlor/install/lib/class.FroxlorInstall.php on line 744

wie gesagt es ist eine Frische installation...

hoffe da kann mir einer ein tip geben wo da der fehler liegt?

 

Edit.:

Der MySQL login klappt ohne probleme, Datenbank wird angelegt, aber sobald Tabellen erstellt werden sollen, da kommt dann diese meldung.

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 1

Noch ungetestet, aber probiers mal mit folgendem Patch in der install/lib/class.FroxlorInstall.php
 

diff --git a/install/lib/class.FroxlorInstall.php b/install/lib/class.FroxlorInstall.php
index 30855bfa..b30f9ed0 100644
--- a/install/lib/class.FroxlorInstall.php
+++ b/install/lib/class.FroxlorInstall.php
@@ -734,8 +734,26 @@ class FroxlorInstall
 
        private function _grantDbPrivilegesTo(&$db_root, $database, $username, $password, $access_host)
        {
+               // mariadb
+               if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '10.0.0', '>=')) {
+                       // create user
+                       $stmt = $db_root->prepare("
+                               CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password
+                       ");
+                       $stmt->execute(array(
+                               "password" => $password
+                       ));
+                       // grant privileges
+                       $stmt = $db_root->prepare("
+                               GRANT ALL ON `" . $database . "`.* TO :username@:host
+                       ");
+                       $stmt->execute(array(
+                               "username" => $username,
+                               "host" => $access_host
+                       ));
+               }
                // mysql8 compatibility
-               if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
+               elseif (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
                        // create user
                        $stmt = $db_root->prepare("
                                CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password

 

Link to comment
Share on other sites

  • 1

Okay, hier herrschen wohl doch größere Unterschiede zwischen MariaDB und MySQL - muss ich fürs nächste release fixen. 

MariaDB:

 | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule  ...]

authentication_rule:
    authentication_plugin
  | authentication_plugin {USING|AS} 'authentication_string'
  | authentication_plugin {USING|AS} PASSWORD('password')

MySQL:

  | IDENTIFIED WITH auth_plugin BY 'auth_string' [AND 2fa_auth_option]
  | IDENTIFIED WITH auth_plugin BY RANDOM PASSWORD [AND 2fa_auth_option]
  | IDENTIFIED WITH auth_plugin AS 'auth_string' [AND 2fa_auth_option]

> For syntax that uses BY 'auth_string', the string is cleartext and is passed to the authentication plugin for possible hashing. 

> For syntax that uses AS 'auth_string', the string is assumed to be already in the format the authentication plugin requires

das "BY" war mal das was bei beiden funktioniert hatte...offenbar nicht mehr

Link to comment
Share on other sites

  • 0

Negativ, sonderzeichen habe ich keine im Passwort drin.

meine Kennworter bestehen lediglich aus Groß & Kleinbuchstaben sowie Zahlen und haben eine Mindestlänge von 32 Zeichen.

hier ein beispiel wie die passwörter aufgebaut sind...

Ain2ohghei6oo6thiHee5lon9meiquoy
aiw1oiyoophoo4cheinu6Ohsai9Ahn7u
Yeiliquoh2ji8ahJ2ucho9eis4aez3gu
Jughu1aboo0io2Iha9ael9eiQuohTh7i
ookiequaCoh5aithoojeing8eiyobara
xueleiphoocoh8ou5IeShieyahgheeD8

da sind keine Sonderzeichen enthalten.

 

der verschluckt sich an dieser Zeile (740-745)

            $stmt = $db_root->prepare("
                CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password
            ");
            $stmt->execute(array(
                "password" => $password
            ));

hab dieses im PhpmyAdmin manuell ausgeführt... mit

Zitat

CREATE USER 'froxlor1'@'%' IDENTIFIED WITH mysql_native_password BY demo;

und bekam als resultat

Zitat

CREATE USER 'froxlor1'@'%' IDENTIFIED WITH mysql_native_password BY demo;

MySQL meldet: 

#1064 - Fehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagen bei 'BY demo' in Zeile 1

 

Link to comment
Share on other sites

  • 0
vor 12 Stunden schrieb みゆき:

Teste Mal PW's  mit ner  Länge von max 16 Zeichen, wenn ich mich recht erinnere hat php-mysql genau so Probleme mit großen PW's wie divecot.

am Kennwort liegt das nicht. Andernfalls dürften die Manuell angelegten benutzer ja auch nicht funktionieren.

Link to comment
Share on other sites

  • 0
11 minutes ago, Akecheta said:

am Kennwort liegt das nicht. Andernfalls dürften die Manuell angelegten benutzer ja auch nicht funktionieren.

Doch ich tippe darauf, das dies genau daran liegt. weil ich das selbe Probleme schon hatte, mit zu langen PW's. Teste es doch einfach mal, schadet ja nicht oder ;)

Link to comment
Share on other sites

  • 0

wunderbar, nun habe ich den ersten fehler damit beseitigt. 

nun kommt aber auch schon der nächste... der will unbedingt ein 41 zeichen Kennwort haben...

Zitat

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1372 Password hash should be a 41-digit hexadecimal number in /www/froxlor/install/lib/class.FroxlorInstall.php:744

 

Link to comment
Share on other sites

  • 0

ok das scheint zu funktionieren, habe nun bezüglich der Datenbank keine fehlermeldung bekommen.

Benutzer, Datenbank und Tabellen wurden erstellt.

was als warnung noch auftaucht

Zitat

Warning: Attempt to read property "property" on array in /www/froxlor/install/lib/class.FroxlorInstall.php on line 558

Warning: foreach() argument must be of type array|object, null given in /www/froxlor/install/lib/class.FroxlorInstall.php on line 558

wäre dieses, aber es klappt alles.

 

 

ggf. kann man beim installieren ja ein Dropdown einfügen in dem man dann MySQL oder MariaDB auswählen kann, dann sparrt man sich die Versionsabfrage

Link to comment
Share on other sites

  • 0
16 minutes ago, Akecheta said:

ggf. kann man beim installieren ja ein Dropdown einfügen in dem man dann MySQL oder MariaDB auswählen kann, dann sparrt man sich die Versionsabfrage

tendenziell eine gute idee ja, aber es soll tatsächlich leute geben die es nicht wissen; oder wahrscheinlicher: system-upgrade und auf einmal ist aus mysql -> mariadb geworden - dann wär das geschrei auch groß :)

Die zwei Warnings schau ich mir mal an, könnte eine php8.x sache sein, danke für den Hinweis

EDIT: die zwei warnings hatte ich schon in der aktuellen 0.11-dev branch gefixed; kann ich also backporten

Link to comment
Share on other sites

  • 0

ah okay, ja das mit dem Auswahl punkt war halt eine Idee ;)

 

oder man nimmt diese auswertung falls machbar von "mysql --version"

Zitat

mysql  Ver 15.1 Distrib 10.5.12-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper

nicht dass MySQL mal eine version ab 10.x hat und dann versehntlich die MariaDB befehle nutzt.

 

@d00p

Danke dir für deine bemühungen. 

Link to comment
Share on other sites

  • 0

ja ich denke da wird man einfach verfolgen müssen wie sich die versionierung von mysql ergibt. Aktuell sollte das so kein problem sein. Ausgabe von "mysql --version" ist natürlich eine Möglichkeit setzt aber wieder voraus, dass ich das im installer (web!) überhaupt ausführen darf! + parsing

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...