[documentation] [Documentation task] MySQL 4.0.x vs MySQL 4.1.x on PHP 5
sepeck
drupal-docs at drupal.org
Fri Jan 5 05:56:42 UTC 2007
Issue status update for
http://drupal.org/node/12958
Post a follow up:
http://drupal.org/project/comments/add/12958
Project: Documentation
Version: <none>
Component: Admin Guide
Category: tasks
Priority: normal
Assigned to: Anonymous
Reported by: Anonymous
Updated by: sepeck
Status: active
already documented in the FAQ
sepeck
Previous comments:
------------------------------------------------------------------------
Mon, 15 Nov 2004 13:59:02 +0000 : Anonymous
Attachment: http://drupal.org/files/issues/mydiff.txt (5.93 KB)
Hello
I have Drupal 4.5.0 installed on my local Windows XP machine (SP2). I'm
running MySQL 4.1.7, PHP 5.0.2 and Apache 2.0.48.
Drupal 4.5.0 used run perfectly with same setup, except I had MySQL
4.0.17 installed.
However, when I installed MySQL 4.1.7, Drupal stopped working, as the
mysql_ extention doesn't work with MySQL 4.1x databases anymore. You
have to use the mysqli_ extensions.
So I set off patching my own Drupal and modified it so that all the
mysql_ function names get's renamed to mysqli_. With the new mysqli_
extension, parameters are passed in a different order, and in some rare
cases, new parameters needed to be passed. This I also fixed.
The Drupal running on my computer is only a devel machine, for writing
modules. The week that I tested this new code, I didn't get any errors
reported in my Apache error log. So I'm sure that it is somewhat stable
enough ;)
However, this patch is not the be-all-end-all. There is one major
problem with it. It changes Drupal in such a way that it makes it
incompatible with MySQL 4.0.x systems (running php 5).
So I suggest not to commit this patch, but to only look at it.
What would really be nice would be to get the database version from
Drupal (ie: 4.0.x vs 4.1.x), and then do an "if" on it.
Ex:
if (mysql_version == mysql4_0) {
mysql_functioname(...);
}
else {
mysqli_functionname(...);
}
Then everywhere where the code needs to do a MySQL call (in
include/database.mysql.inc), you place it in an "if (mysql_version ==
mysql4_0) {" block. I agree, it's probably not the best way to do it.
Hope it helps. Mail me if you have any questions/queries/commentc etc..
Willie
------------------------------------------------------------------------
Mon, 22 Nov 2004 10:37:27 +0000 : Gábor Hojtsy
There is absolutely no need to change the mysql extension to mysqli for
MySQL 4.1+, only the connection password needs to be set with
OLD_PASSWORD(). I guess you hit the Client does not support
authentication protocol requested by server; consider upgrading MySQL
client [1] error, you beleived in it...
Drupal needs to have instructions for MySQL 4.1+. See the mailing list
for the thread I have started.
[1] http://dev.mysql.com/doc/mysql/en/Old_client.html
------------------------------------------------------------------------
Sat, 27 Nov 2004 10:07:01 +0000 : Dries
This patch can't be applied without breaking older systems. Marking
this 'active' instead.
------------------------------------------------------------------------
Tue, 26 Apr 2005 14:56:13 +0000 : qube
I run MySQL version 4.1.10 and PHP 4.3.10 on my devel machine and
several php sites (including Drupal 4.6.0) have problem with special
accented characters. Everything afer the accented character including
that character is deleted.
Sometimes it goes well, sometimes it does not. For example when running
cron, the search_index table gets a lot of duplicates, beacouse words
are truncated and thus causing duplicity.
This one of many similar errors I get running cron:
user error: Duplicate entry 'liber' for key 1
query: INSERT INTO drupal_search_total (word, count) VALUES
('liber�ln�', 0) in D:\www\bv\includes\database.mysql.inc on line
66.
But inserting node with accented characters seems fine. So far I don't
know what are the exact conditions when this happen.
I'm not sure, whether this problem exists in 4.5.0, beacouse I didn't
played so much with 4.5.0 on my devel machine.
I use utf8 encoding for database and collation utf8_general_ci (I tried
also other collations but without success).
------------------------------------------------------------------------
Wed, 27 Apr 2005 05:44:28 +0000 : qube
The conclusion from my previous post is that there are maybe more issues
regarding MySQL 4.1 and mysql PHP extension then just old style
password.
------------------------------------------------------------------------
Thu, 11 Aug 2005 00:47:20 +0000 : killes at www.drop.org
There is no need to change anything according to Goba, but it shoudl be
documented. Moving
qube: You need to check the encoding setting for your database.
More information about the documentation
mailing list