Download & Extend

Remove mysql (no i) as an option when mysqli is available

Project:Drupal core
Version:6.x-dev
Component:install system
Category:task
Priority:normal
Assigned:David Strauss
Status:closed (fixed)

Issue Summary

I don't think there's any reason to offer mysql as a database library when mysqli is available. The only reason to use mysql when mysqli is available is to access MySQL 3.x and 4.0 databases, which Drupal 6 will not support.

Comments

#1

My cvs diff produced a cabbage patch kid. This only removes mysql as an installation option when mysqli is available. It also removes a redundant call to drupal_detect_database_types().

AttachmentSizeStatusTest resultOperations
no_mysql_if_mysqli.patch1.03 KBIgnored: Check issue status.NoneNone

#2

Updated to remove an extra space.

AttachmentSizeStatusTest resultOperations
no_mysql_if_mysqli_0.patch1.03 KBIgnored: Check issue status.NoneNone

#3

Status:active» needs review

#4

+1 this i a logical change, mysqli is the better way to go. i'd remove that comment along with the redundant drupal_detect_database_types() call.

#5

This patch removes the extraneous comment.

AttachmentSizeStatusTest resultOperations
no_mysql_if_mysqli_1.patch1.04 KBIgnored: Check issue status.NoneNone

#6

Status:needs review» reviewed & tested by the community

This is a really simple change. I think this is RTBC.

#7

As most ppl have only the choice between mysql and mysqli this is a very good patch as the select box itself will disappear. If someone installs without PHP knowledge she will have no idea what mysqli whatsoever, so it's very good to automate the choosing.

#8

I was just following this on irc, looked in my settings.php file, and whoops - it's been mysql (no i) since we originally installed on drupal 4.5.x - I kept c&ping that line in from settings.php to settings.php every upgrade and it never crossed my mind to use mysqli until I saw this patch.

So I think it'd be more than worth adding a prompt somewhere in the upgrade process, or maybe the status logs?, suggesting people switch. Not necessarily part of this patch though.

#9

@catch settings.php is typically not writable during upgrades, but we could put it in as a warning on the site report page if you're using mysql and mysqli is available.

#10

we could put it in as a warning on the site report page if you're using mysql and mysqli is available.

That sounds great. Big +1 to the idea in general.

I would've caught it as soon as I upgraded to 5.x had that warning been in place, but as it was I overlooked completely. I guess 4.5.x defaulted to mysql so I used that, and never gave it another thought afterwards. Most people just copy their settings.php back into the folder after upgrading drupal files, so you might never even look at your settings.php after installing - especially now it's web based.

#11

What exactly is the benefit of mysqli over mysql when you're not using any of the newer MySQL features? I don't believe we are...

#12

@Crell

* There's no advantage for mysql over mysqli.
* We're already requiring MySQL 4.1, the minimum DB for mysqli.
* Pointless choices are bad things to ask of users.
* mysqli has cleaner code than mysql.

#13

Status:reviewed & tested by the community» fixed

Good catch. Thanks, David.

#14

@catch See #149537 for my patch to add the warning.

#15

Assigned to:Anonymous» David Strauss

#16

Status:fixed» closed (fixed)