Blog.Andrei.MD

Andrei Railean's Image

I am Andrei Railean

Andrei.MD is all about me

Article Archive RSS

Nov
5th
Fri
permalink

PHP MySQL localhost not finding socket on mac

On my mac, PHP wouldn’t connect to MySQL to “localhost” server. It turns out that when “localhost” is used, MySQL uses sockets instead of TCP/IP connection. Terminal mysql access to localhost was fine, which suggested that there’s nothing wrong with MySQL config. Only after a while did I think to look at php.ini to see if there are any setting there. Yep, my mac uses /tmp/mysql.sock and php.ini was setup to use /dev/mysql/mysql.sock. After changing to /tmp/mysql.sock and restarting apache it now works like it should. 

Hope you find it helpful.

Comments (View)
Tags: MySQL technical developer
Apr
27th
Tue
permalink
I used to fire up Apple Calculator every time I needed a few simple numbers added. I also always turned on the “paper tape” window. Now I just use the Chrome Developer Tools console (Command+Option+J) and do all my calculations straight there. Added bonus is that I can assign data to variables (which I rarely do, but still like the fact that I can). It’s way more intuitive then remembering what those “M”, “MC” and “MR” buttons do on the calculator. :)
This all came about when I started playing with JavaScript development and localStorage in HTML5.

I used to fire up Apple Calculator every time I needed a few simple numbers added. I also always turned on the “paper tape” window. Now I just use the Chrome Developer Tools console (Command+Option+J) and do all my calculations straight there. Added bonus is that I can assign data to variables (which I rarely do, but still like the fact that I can). It’s way more intuitive then remembering what those “M”, “MC” and “MR” buttons do on the calculator. :)

This all came about when I started playing with JavaScript development and localStorage in HTML5.

Comments (View)
Tags: chrome developer technical