Mac as a web server revisited

To recap on the issue I had in my presentation re: "How to turn your Mac into a database-driven web server"

http://www.siliconmeadow.net/mac-as-web-server

at the June meeting, I had got to the stage of installing mySQL and configuring it via the terminal, but I could get no PHP scripts to access the database do to a conflict with "old" password hashing and the "new-style" 4.1.x passwords that mySQL uses.

Even when specifying that you want to set a user's password in the old style, using OLD_PASSWORD('password'), it still wouldn't work properly with PHP scripts.

I haven't had much time to look at it until the past couple of days, and what I can see on my development system (G5) and my production Linux box (running Red Hat AS 4 on an AMD3200 - I think) is that they are both configured with "old_passwords=1". I can see on the Linux box that the file "/etc/my.cnf" has this configured in the mysqld block.

On the otherhand, on the Mac, it would be appear to be using this file for configuring the startup parameters first:

/usr/local/mysql/support-files/mysql.server

and in that file it says it will then load any information from /etc/my.cnf. This file isn't present on new installations of the Mac OS version of mySQL.

I hope you're still following...

On my normal development machine, I'm running mySQL 4.1.16-standard. I can't remember if I've upgraded from older versions, but I suspect I have. I've never had to sort any issue out with the OLD_PASSWORDS option. No "/etc/my.cnf" present.

On the new development drive I set up for the presentation, it's got mySQL 4.1.20-standard. It doesn't have an "/etc/my.cnf" file either. However, once I created one, with only these two lines:

[mysqld]
old_passwords=1

It worked properly.

Because I want to complete this documentation properly and provide the best and easiest information to help people get to the next level, I'd like to have some advice and opinions on the following:

  1. Do we settle for the old_password option? The new password scheme is supposed to be more secure, but was the old scheme THAT insecure?
  2. Does anyone know if Apple will be updating PHP with the mysqli extension, which is required for the new password hashing? If not, shall I add "Compiling a version of PHP with mysqli" in the documentation?
  3. Did I leave the iron on?

Comments

I am new to both PHP and MySQL and I am having a difficult time figuring out how to get them to interact. I have MySQL 5.0.24 and PHP 4.3.11. What do I do? I want to use mysqli.

Hi,

The only way I've been able to get PHP to connect to mySQL using the mysqli extension was to building my own version of PHP. I was trying that out last year on a laptop from a previous employer, but sadly had to give it back at the end of last year, so I've not revisited it.

I have, however, recently seen this package which looks promising:

http://www.mamp.info/

I think it might have later versions than all the stuff you get in a standard install.

HTH,

Richard 

Thank you very much! I have not tried it, since I ended up using old_passwords and mysql instead of the mysqli extension, but from all appearances MAMP is a godsend for anyone wrestling with the particular (and somewhat frustrating) problem of configuring Mac OS X, Apache, MySQL, and PHP. Thanks again, George

This is important and reminded stuff. You provide a concise material on this subject for creating awareness. Brilliant work! http://www.irepliquemontresluxe.com

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><p><img><blockquote><h1><h2><h3><h4><h5><h6>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.
 


 The Right Way