DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Forums
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS

OSXFAQ Mac OS X UNIX Tip-of-the-Day  back to index

MySQL - PHP and Passwords

By Adrian Mayo - Editor - OSXFAQ

The first three tips showed how to install MySQL and how to create a new database and user. If you wish to use MySQL with Apache-PHP, and you are using Apple's PHP install, then you'll have problems.

Firstly, Apple's PHP install, at the time of writing, was built to use old-style MySQL password encryption, whereas MySQL 4.1 and later use the new-style encryption.

To allow PHP to connect to a database, either don't give a password by missing out:

identified by 'password';

when you create a new user. Alternatively, create a new user with an old-style password. To do this, create the user as given in Wednesday's tip and then type (this example shows a user called jan):

# mysql -u root -p
Enter password:
mysql> set password for jan@localhost = old_password('jans-password');
mysql> quit
Bye
$

Also, as of the Tiger 10.4.4 update, and until Apple corrects it, the Apache-PHP module was built in a way that's incompatible with most MySQL installs. This can be corrected by building your own PHP install, as shown in Friday's tip.


Visit the Site of the Book of the Unix Tips:


Discuss this trick in the OSXFAQ Learning Center forum

E-mail your comments or suggestions to webmaster@osxfaq.com


Copyright © 2000-2008 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.