Open guilegatan opened 1 year ago
I think you must use PHP 7.x. As soon as I switch to PHP8.1 I get the same error.
PHP 8 should be working, due to the contribution of several people of the community, but unfortunaly at the moment I really don't have time to debug this particular matter, so from just reading the log, it looks like a MySQL problem, not PHP, and it seems to revolve around "sql_mode"
Probably related to this: https://stackoverflow.com/questions/50336378/variable-sql-mode-cant-be-set-to-the-value-of-no-auto-create-user
Important Change: Importing a dump from a MySQL 5.7 server to a server running MySQL 8.0 often failed with ER_WRONG_VALUE_FOR_VAR when an SQL mode not supported by the 8.0 server was used. This could happen frequently due to the fact that NO_AUTO_CREATE_USER is enabled by default in MySQL 5.7 but not supported in MySQL 8.0.
The behavior of the server in such circumstances now depends on the setting of the pseudo_slave_mode system variable. If this is false, the server rejects the mode setting with ER_UNSUPPORTED_SQL_MODE. If pseudo_slave_mode is true, the server ignores the unsupported mode and gives a warning. Note that mysqlbinlog sets pseudo_slave_mode to true prior to executing any SQL. (Bug #90337, Bug #27828236)
_
Cheers
Finally got it working with PHP 8.1 with some help from our database guys for the production machines! Thanks everyone for the input! Looking forward to an official version 2.8.5.6.
Hi, do you have an list of the changes you made?
I confirmed the above error is showing because 'NO_AUTO_CREATE_USER' has been deprecated since MySQL 8.0.11. See the following link for more info: https://stackoverflow.com/questions/71110454/no-auto-create-user-in-mysql-8-0
I removed NO_AUTO_CREATE_USER from MySqlConnection.php and that fixed the problem for me.
My environment:
I can also confirm it's not working with MySQL 8. Wiki should indicate that MySQL Version should be < 8.0.11 so far?
@hakito ,
did you try the solution that was given by @TheHLee on Sep 6 ?
Yes I tried it and the error was gone. But because I was unsure about other potential problems, I returned to an older MySQL Version.
@hakito, glad your problem is gone. Could you please close this issue?
@colisee I can't close it - I did not open the issue!
There are two solutions/workarounds:
However, the line from the second option is removed when you edit the configuration in the admin menu (tested in v2.8.6.1). So the first solution is the better one.
Thus, the issue should not be closed until this is fixed.
Sorry to bring it up again. I am still out of luck with PHP 8.1.9/MySQL 8.0.32
I installed the latest development version, and also installed Composer as mentionend somewhere else.
These are my last log lines in the apache error.log:
[Fri Feb 10 09:20:22.790289 2023] [php:notice] [pid 966] [client 192.168.0.15:31342] Error: mysqli_sql_exception: Variable ' sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER' in /var/www/html/app-develop/lib/Database/MySQL/MySqlConnection.php:72\nStack trace:\n#0 /var/www/html/app-develop/lib/Database/MySQL/MySqlConnection.php(72): mysqli_query()\n#1 /var/www/html/app-develop/lib/Database/Database.php(27): MySqlConnection->Query()\n#2 /var/www/html/app-develop/Domain/Access/AnnouncementRepository.php(11): Database->Query()\n#3 /var/www/html/app-develop/Presenters/LoginPresenter.php(123): AnnouncementRepository->GetFuture()\n#4 /var/www/html/app-develop/Pages/LoginPage.php(124): LoginPresenter->PageLoad()\n#5 /var/www/html/app-develop/Web/index.php(25): LoginPage->PageLoad()\n#6 {main}, referer: https://testserver.my.url/app-develop/Web/index.php [Fri Feb 10 09:20:22.790371 2023] [php:notice] [pid 966] [client 192.168.0.15:31342] #0 /var/www/html/app-develop/lib/Common/Logging/ExceptionHandler.php(22): WebExceptionHandler->HandleException(Object(mysqli_sql_exception))\n#1 [internal function]: ExceptionHandler::Handle(Object(mysqli_sql_exception))\n, referer: https://testserver.my.url/app-develop/Web/index.php [Fri Feb 10 09:20:24.363937 2023] [php:notice] [pid 966] [client 192.168.0.15:31342] Error: mysqli_sql_exception: Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER' in /var/www/html/app-develop/lib/Database/MySQL/MySqlConnection.php:72\nStack trace:\n#0 /var/www/html/app-develop/lib/Database/MySQL/MySqlConnection.php(72): mysqli_query()\n#1 /var/www/html/app-develop/lib/Database/Database.php(27): MySqlConnection->Query()\n#2 /var/www/html/app-develop/Domain/Access/AnnouncementRepository.php(11): Database->Query()\n#3 /var/www/html/app-develop/Presenters/LoginPresenter.php(123): AnnouncementRepository->GetFuture()\n#4 /var/www/html/app-develop/Pages/LoginPage.php(124): LoginPresenter->PageLoad()\n#5 /var/www/html/app-develop/Web/index.php(25): LoginPage->PageLoad()\n#6 {main}, referer: https://testserver.my.url/app-develop/Web/index.php [Fri Feb 10 09:20:24.363999 2023] [php:notice] [pid 966] [client 192.168.0.15:31342] #0 /var/www/html/app-develop/lib/Common/Logging/ExceptionHandler.php(22): WebExceptionHandler->HandleException(Object(mysqli_sql_exception))\n#1 [internal function]: ExceptionHandler::Handle(Object(mysqli_sql_exception))\n, referer: https://testserver.my.url/app-develop/Web/index.php
can anyone give me a hint how you got it working? I tried a clean Ubuntu 22.04 install with PHP 8.1.9 and MySQL 8.0.32, and imported my LibreBooking database from my Ubuntu 20.04/PHP 7.4.3/MySQL 8.0.32-server, but with no luck.