chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
771 stars 470 forks source link

bug with database names at step 4 of installation #5154

Open spacecabbie opened 5 months ago

spacecabbie commented 5 months ago

Describe when installing chamilo at step 4 there is a small old bug, basicaly if you have a database named: username_chamilo-database (many hosting providers use user as pre tag) when you check database connection or go next no error show and test is succsesfull, but it removed the - sign for the databasename field.

`2024-02-10 00:23:06.725482 [NOTICE] [3373637] [145.224.125.146:53746-2#dev.chamilo.org-80] [STDERR] PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'username_chamilo-database'@'localhost' to database 'username_chamilodatabase' in /home/spacecabbie/domains/dev.chamilo.org/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:55 Stack trace:

0 /home/spacecabbie/domains/dev.chamilo.org/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(55): PDO->exec()

1 /home/spacecabbie/domains/dev.chamilo.org/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1534): Doctrine\DBAL\Driver\PDOConnection->exec()

2 /home/spacecabbie/domains/dev.chamilo.org/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(1049): Doctrine\DBAL\Connection->executeStatement()

3 /home/spacecabbie/domains/dev.chamilo.org/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(433): Doctrine\DBAL\Schema\AbstractSchemaManager->_execSql()

4 /home/spacecabbi in /home/spacecabbie/domains/dev.chamilo.org/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 112

` note the removed - in the databasename in this error

To Reproduce fresh install and name the new database like username_chamilo-database

Expected behavior obviously it should not adjust the db name rather give and error or just procceed without change of name.

Screenshots https://imgur.com/a/tfUXb5L

ywarnier commented 5 months ago

Yes. There's something about dashes (I think the - is the issue, not the _) that we don't accept. I don't remember why, but there was a reason for that.

spacecabbie commented 5 months ago

Yes it does seemed familiar was unsure if i ever made a bug report or if it was supposed to be fixed