Hello,

I am new to Backdrop and I get a problem while installing.

I create the Database, key in the parameters : database name, database user and password ... and I get a weird message :

Error: Call to undefined method DatabaseConnection_mysql::exec() in DatabaseConnection_mysql->createDatabase() (line 217 of /var/www/consult/core/includes/database/mysql/database.inc).

I am trying to install on a Debian Bookworm with MariaDB 10.6 and PHP 8.1.7, the Backdrop version is 1.23.
All required PHP extension are installed (the first screen was OK).

Regards

JPP

Comments

Hello, jpp. Thanks for posting!

You have found a bug. I'll create an issue ticket. Backdrop is trying to create the database for you, but it's failing to do so because of the bug. 

It seems in your message that you tried manually creating the database before running the installation. However, Backdrop is NOT finding that manually created database (which is why it's trying to create it from scratch). This may be due to database prefixing (some servers, especially in shared hosting, prefix the databases). My guess is that the database name you are entering during the installation process is different from the one that was created in the server. Can you check on that?

I'll post later, here, the issue number about the bug you found.

FYI, I posted the issue.

You have three options at this point. For any of these, but sure to start with a COMPLETELY clear codebase (i.e. delete the folder where you had the Backdrop code, and put it there again).

1. Be sure you manually create the database and enter the corrected name in the form (correctly prefixed).

2. Do #1 above and actually edit settings.php in the root of Backdrop, and manually enter the database name, database username and passwords there

3. OR Try fixing lines 217 and 218 of core/includes/database/mysql/database.inc to:

$this->pdo->exec("CREATE DATABASE IF NOT EXISTS $database"); $this->pdo->exec("USE $database");

This last one is just a temporary fix and not recommended (changing core files is not a good idea).

 

Hello,

Many thanks, I had today a very long work day, I will try your suggestions tomorrow.
I will share the results ...

Regards

JP P