| |||||||||||
| |||||||||||
Connecting to MySQL 5 from PHP on Mac OSX Leopard
What is the difference between "localhost" and "127.0.0.1"? Everything, it seems, when you're trying to connect MySQL (and I have version 5.0.37 Community at the moment) running on Mac OSX - the latest Leopard release - with their PHP release including the MySQL drivers. It's PHP release 5.2.4.
In a nutshell: mysql_connect("localhost","wellho","nottherealpassword");FAILS with an error message: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Library/WebServer/live_html/test/test.php on line 2 but: mysql_connect("127.0.0.1","wellho","nottherealpassword");works just fine. Another gem ... to add to the loss of classic mode (serious issue for us FrameMaker users!) and the movement of configuration files. I have to admit this hasn't been the easiest of upgrades, and I wait to see whether I have more issues to find. If you want to learn all about Apache httpd installation / configuration - and the PHP and MySQL elements too - see our LAMP deployment course. I'm the tutor and the "L" for Linux is close enough to the "M" for Mac OSX for it to be pretty damned close and very effective training. And I can and will show you how it works on my Mac too ;-) (written 2007-12-03 09:40:53) Associated topics are indexed under S159 - MySQL 5 and PHP 5A602 - Web Application Deployment - Apache httpd - Sourcing, Installation, Testing
Some other Articles
Interactive training, and advancing techniques furtherThe wrong way to put up prices A day in Ljubljana Right up to the top of the City Connecting to MySQL 5 from PHP on Mac OSX Leopard From Sunday to Monday, from Melksham to the Balkans What makes our courses special? Santa on the train to Melksham More PHP sample and demonstration programs Easy selection of multiple SQL conditions from PHP 1690 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||