[nycphp-talk] installing mysql 4.1 (windows)
Adam Maccabee Trachtenberg
adam at trachtenberg.com
Wed Feb 18 03:27:06 EST 2004
On Wed, 18 Feb 2004, Daniel Convissor wrote:
> Okay, now the trick is getting it to work with PHP. I've got a recent
> snapshot of PHP 5. Seems the mysqli extension isn't built in (though the
> mysql extension is). So, am I going to have to compile PHP from scratch
> to get this functionality?
As of MySQL 4.1, the MySQL client libaries are GPLed, so it is
*illegal* for PHP to bundle them due to license issues. (PHP is not
GPLed.) For all I know right now, due to MySQL's super loose
interpretation of the GPL, even using MySQL 4.1 in your PHP
application makes it GPLed.
(I will let others field that, see
http://www.omniti.com/~jesus/scriptures/archives/000111.html#more for
one view.)
Anyway, it does mean you need link PHP and MySQL yourself. On Unix (at
least Mac OS X), this requires downloading MySQL and doing something
like this:
--with-mysqli=/usr/local/mysql/bin/mysql_config
Note that this is different than what you'd need to pass to use the
mysql extension. I believe mysql_config may be new to MySQL 4.1.
Since I never use Windows, you're on your own to determine whether
this means you need to rebuild PHP, but I'm guessing the answer is
yes. Hopefully, Wez's super-kool build system will know how to do
this. :)
I am also interested in learning if this means that it is illegal for
people to distribute PHP binaries with build-in MySQL support and
packaged AMP installers, either for Windows or Unix. I think the
answer may be yes. If so, I think MySQL is really shooting themselves
in the foot with the GPL. Must talk to Zak.
> Saw the PHP docs for mysqli say
>
> Note: The mysqli extension is designed to work with the version 4.1.2
> or above of MySQL. For previous versions, please see the MySQL
> extension documentation.
>
> Is that right? 4.1.2 isn't out. I just tried connecting to 4.1.1 using
> mysql_connect(). In order to get it to work,[1] I had to update the
> Password column in the user table to "old_password(Password)." Well, this
> is well and good, but I really need to be testing the mysqli extension.
4.1.2 is correct. According to the MySQL folks, you should be using the
latest bit keeper! (Yes, that's right, they don't use CVS.) I am
currently avoiding problem by downloading snapshots from
http://downloads.mysql.com/snapshots.php. (Don't want to install bit
keeper or upgrade auto tools / bison.)
Note that you cannot (currently) use MySQL 5.0 because not all of the
MySQL 4.1.x changes have been merged into that trunk. This was as of
last week, at least, when I last e-mailed by Georg; however, he said
that Monty promised to merge these changes "soon."
> Any leads to getting mysqli working are welcome.
Good luck. :)
> [1] The initial attempts to connect via mysql_connect() failed:
> "Client does not support authentication protocol
> requested by server. Consider upgrading MySQL client"
Gah! No you **MUST** use mysqli to talk to MySQL 4.1 databases if you
want to use any of the special features like bound parameters.
You CANNOT use mysql with MySQL >= 4.1.2 and CANNOT use mysqli with
MySQL <= 4.0.x. (And you cannot use MySQL 4.1.0 and 4.1.1 at all with PHP.)
I don't know if your old_password() trick works completely, but it
will probably bork other unknown things. I would guess that the MySQL
folks would consider this a nasty hack. Of course, if it does work
100%, I will be pleasantly happy and will want to know about this. :)
-adam
PS: Please let me know if bound output parameters work correctly with
integers. Right now it is busted on my machine, but I don't know if
this is a fault with my set up or the extension.
PPS: This is what I mean by the fact that nobody is using PHP 5. :)
--
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!
More information about the talk
mailing list