Centuran / OTRS-Community-Edition

((OTRS)) Community Edition is a freely available, open source, web-based ticketing system used for Help Desk, Customer Service, and IT Service Management purposes.
https://otrscommunityedition.com/
GNU General Public License v3.0
45 stars 10 forks source link

Installer failed to create user and grant permissions #22

Open makhomed opened 1 year ago

makhomed commented 1 year ago

Installer failed to create user and grant permissions.

error in SQL syntax:

[Wed Aug 16 22:01:45 2023] -e: DBD::mysql::db do failed: 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 'IDENTIFIED BY 'Mwd74PKo6CtOMUxM' WITH GRANT OPTION' at line 1 at /opt/otrs/Kernel/Modules/Installer.pm line 555.

used MySQL Server version: 8.0.33-25 Percona Server (GPL), Release 25, Revision 60c9e2c5

patch:

[root@otrs /opt/otrs/Kernel/Modules]# diff -u /opt/otrs/Kernel/Modules/Installer.pm.orig /opt/otrs/Kernel/Modules/Installer.pm
--- /opt/otrs/Kernel/Modules/Installer.pm.orig  2023-04-05 09:33:21.000000000 +0000
+++ /opt/otrs/Kernel/Modules/Installer.pm       2023-08-16 22:10:39.578986950 +0000
@@ -506,7 +506,8 @@

                 @Statements = (
                     "CREATE DATABASE `$DB{DBName}` charset utf8",
-                    "GRANT ALL PRIVILEGES ON `$DB{DBName}`.* TO `$DB{OTRSDBUser}`\@`$DB{Host}` IDENTIFIED BY '$DB{OTRSDBPassword}' WITH GRANT OPTION",
+                    "CREATE USER `$DB{OTRSDBUser}`\@`$DB{Host}` IDENTIFIED BY '$DB{OTRSDBPassword}'",
+                    "GRANT ALL ON `$DB{DBName}`.* TO `$DB{OTRSDBUser}`\@`$DB{Host}` WITH GRANT OPTION",
                     "FLUSH PRIVILEGES",
                 );
             }