Which is better in term of perormance and number of queries.
mysql or mysqli driver.
----
Sharique

Comments

vm’s picture

mysqli is for PHP5 and can outperform mysql. if you arent using php5 then you can't use mysqli

sharique’s picture

Can I change driver from mysql to mysqli for a running site.
------
Sharique uddin Ahmed Farooqui
IT head, Managefolio.com

Sharique Ahmed Farooqui

vm’s picture

open settings.php change $db_url from mysql to mysqli, check for inconsistencies, if none, then you are fine. if you find inconsistencies, change it back.

Solariss’s picture

I just had an error of server #500
I had installation of D7 Mysql and I switched it to Mysqli

vm’s picture

Drupal 7 uses PDO, whose mysql driver is named "mysql". There is no mysqli support in Drupal 7, only PDO-based drivers.

federico’s picture

I'm searching for information on this subject, and haven't found a lot yet.

So far as i understand (i'm not a programmer), mysqli can be faster than mysql, but only if php code is optimized to use mysqli features(?). Drupal can run with both mysql and mysqli, i guess that if you choose mysli, drupal will use /includes/database.mysqli.inc instead of /includes/database.mysql.inc , and take some advantage of mysqli?

___
Federico
http://www.zonaeconomica.com

vm’s picture

i guess that if you choose mysli, drupal will use /includes/database.mysqli.inc instead of /includes/database.mysql.inc , and take some advantage of mysqli

yes.

junphine’s picture

mysqli not support pooled connection. mysql_pconnect is not support.
the advantage of mysqli is it can call store procedure of mysql.

welcome to web.srv.cn

drupallapurd123’s picture

I am having this same problem. In my settings.php file I have:

$db_url = 'mysql://username:password@localhost/databasename';

and I'm using WAMP Server 2 with PHP 5.2.9-2 (though I also have 5.3.0), MySQL 5.1.36 and Apache 2.2.11. Both php_mysql and php_mysqli are enabled under the PHP extensions menu of WAMP Server 2.

However, I can not get past the "Set up database" stage of the Drupal installation at "http://localhost/drupal/drupal-6.13/install.php?profile=default&locale=en". Yes, the database I am entering does exist, the username and password is correct, and I have the service online.

At no point in the install process did Drupal ask me to choose between mysql or mysqli but under the "Database name" box reads "The name of the mysqli database your Drupal data will be stored in. It must exist on your server before Drupal can be installed." which suggests to me that Drupal is asking specifically for a mysqli database(?).

Can anyone please tell me why this is not working or how to fix it? Thanks in advance.

vm’s picture

in sites/default

do you have 2 files?
default.settings.php
AND
settings.php?

sounds like you renamed default.settings.php without copying it first.

phuedx’s picture

Make sure you have the value of mysqli.default_socket set to the correct value in the php.ini file. Very recently I had the same problem and I found that MySQLi was attempting to connect to a socket that didn't exist!

Regards,

Sam

francewhoa’s picture

VM is correct mysqli outperform mysql. But if you want to use mysqli you need PHP version 5.

Difference between mysqli and mysql from mysql.com at http://drupal.org/node/297292#comment-970973

Loving back your Drupal community result in multiple benefits for you