MySQL and PHP

February 13, 2009
Tags:

I decided my question about getting an auth key for my laptop vs. my website was moot unless I could prove to myself that I could build anything on my laptop that would need an auth key at all.  I messed around with mysql on our website once upon a time, so I knew I could do it there, but I’d never installed it on my laptop.  I had Apache running on my laptop already because I deployed Wonderland and built a little room in it last fall.

So yesterday I installed mysql, in order to get the demo php CO2 Calculator working, and it worked!  runs exactly the same on my laptop as on that website.  Next step: understand the code and see if I can make changes that work.

It was really quite straightforward, but took a while as I am too curious for my own good and insist on understanding things that the MacBook Pro philosophy seems to think I should not worry my little head about.  I learned useful things though like mdfind will find things in /etc (aka /private/etc) that Spotlight will refuse to find, because Spotlight will not look in /private.  mdfind is nicer than find for quick searches.  Besides my curiosity, there were a number of small but real obstacles to enabling php to work with apache and connect to mysql on my localhost.

Because I had just installed mysql, I still had the mysql client running when I got the calculator running, so I was able to look at the changes in my database that were made by the calculator.  As I expected, the only data put in my database is the user account information.  The user-input data, about cars and heating and so on, is all stored at amee and used for the calculations about the spent carbon.

Share

Leave a Reply