0

I have tried to connect to Mysql DB using Mysqli by declaring 'driver' => 'mysqli' inside DB array in settings.php but I get the following error:

Warning: require_once(/srv/http/my-domain/includes/database/mysqli/database.inc): failed to open stream: No such file or directory in /http/www/my-domain/includes/database/database.inc on line 1688

Thanks.

2
  • No, the file does not exist.
    – W.M.
    Commented Dec 6, 2014 at 19:19
  • 1
    Uses PDO, better than MySQL driver and similar to mysqli
    – mikeytown2
    Commented Dec 7, 2014 at 1:10

1 Answer 1

2

No. Drupal 7 does not come with Mysqli support. It only comes with PDO based drivers for MySQL, pgSQL and SQLite.

https://www.drupal.org/node/310070

https://www.drupal.org/requirements/pdo

See the files :

  • INSTALL.mysql.txt
  • INSTALL.pgsql.txt
  • INSTALL.sqlite.txt

to find out more about how to install using each option.

There are also many community provided solutions for connecting to other databases including MsSQL, Mongo and Oracle.

Have a look at the Drupal modules page for more information on database drivers

The core advantage of PDO over MySQLi is in its database driver support. PDO supports 10+ different drivers, opposed to MySQLi, which supports MySQL only.

If you are interested in the comparison between PDO and Mysqli there are many articles around including this one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.