WordPress.org

Support

Support » Plugins and Hacks » I’ve changed WordPress 2.0.5 to use mysqli instead of mysql

I’ve changed WordPress 2.0.5 to use mysqli instead of mysql

Viewing 7 replies - 1 through 7 (of 7 total)
  • Don’t edit wp-db.php. Instead, name the file db.php and stick it in your wp-contents folder. WordPress will automatically use it instead of the default one. 😉

    that doesn’t seem to work for me (?)

    i also grepped the source and see no reference to testing for the existence of a db.php file …

    Viper, your suggestion will only work with the next major update to WordPress (currently referred to as 2.1).

    Mike, if you want the *feature* Viper mentioned, you can modify your wp-settings.php so that the following line in it:

    require_once (ABSPATH . WPINC . '/wp-db.php');

    is instead:

    if ( file_exists(ABSPATH . 'wp-content/db.php') )
    require (ABSPATH . 'wp-content/db.php');
    else
    require_once (ABSPATH . WPINC . '/wp-db.php');

    why not just throw in an actual database abstraction layer, or mysqli support in the distribution? 🙂

    I must agree. Lack of mysqli support in WordPress is the one thing hindering/stopping me installing my own WordPress.

    I have tried a few times to fix this, but can never get it all working.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    What is the advantage of using the mysqli extension? I’m not seeing any, except that:
    a) it requires a certain version of MySQL,
    b) it requires that your PHP have support for it (which is not there by default)

    It doesn’t change the actual end result, so what’s the point?

    When it was first introduced, it was claimed to be better all around. Of course, I am seeing mixed opinions about that. It most definitely has more features including prepared statements (which can speed up redundant/paramaterized queries) and can prep the input data appropriately and safely. It also uses the newer MySQL authentication API it appears (which I think use stronger encryption for passwords.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘I’ve changed WordPress 2.0.5 to use mysqli instead of mysql’ is closed to new replies.