giandonatoinverso / PHP-Dynamic-Qr-code

PHP Dynamic Qr code is a script that allows the generation and saving of dynamic and static QR codes
MIT License
268 stars 76 forks source link

sql access denied - Fatal Error #106

Closed cypher2001 closed 4 months ago

cypher2001 commented 4 months ago

Pretty stock installation on docker LXC

Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'qrcode'@'172.18.0.3' (using password: YES) in /var/www/html/lib/MysqliDb/MysqliDb.php:323 Stack trace: #0 [internal function]: mysqli->__construct('php-dynamic-qrc...', 'qrcode', Object(SensitiveParameterValue), 'qrcode', 3306, NULL) #1 /var/www/html/lib/MysqliDb/MysqliDb.php(323): ReflectionClass->newInstanceArgs(Array) #2 /var/www/html/lib/MysqliDb/MysqliDb.php(415): MysqliDb->connect('default') #3 /var/www/html/lib/MysqliDb/MysqliDb.php(1988): MysqliDb->mysqli() #4 /var/www/html/lib/MysqliDb/MysqliDb.php(1594): MysqliDb->_prepareQuery() #5 /var/www/html/lib/MysqliDb/MysqliDb.php(738): MysqliDb->_buildQuery(1) #6 /var/www/html/lib/MysqliDb/MysqliDb.php(764): MysqliDb->get('users', 1, '*') #7 /var/www/html/authenticate.php(17): MysqliDb->getOne('users') #8 {main} thrown in /var/www/html/lib/MysqliDb/MysqliDb.php on line 323

cypher2001 commented 4 months ago

Seems this comes to play with changing any of the "changeme" passwords.

giandonatoinverso commented 4 months ago

Have you changed the password in both docker compose services? And anyway, I do periodic installations and have never encountered this bug

jerefrer commented 3 months ago

Same here just now, I tried changing the password for both services, like so:

services:
  php-dynamic-qrcode:
    environment:
-     DATABASE_PASSWORD: "changeme"
+     DATABASE_PASSWORD: "iUbvnrgVO8BXxTq9OEeO5O5SrPm41j72"
  php-dynamic-qrcode-db:
    environment:
-     MYSQL_ROOT_PASSWORD: "changeme"
+     MYSQL_ROOT_PASSWORD: "iUbvnrgVO8BXxTq9OEeO5O5SrPm41j72"
-     MYSQL_PASSWORD: "changeme"
+     MYSQL_PASSWORD: "iUbvnrgVO8BXxTq9OEeO5O5SrPm41j72"

And got the error mentioned by @cypher2001.

I then tried with the default passwords and then I could log in with superadmin/superadmin.

Could the password be too long or something ? Or did I miss something else ?