mysql

OS X 10.7 Lion Development: MacPorts

OS X Lion comes with most of the tools you would need to do "MAMP" (Mac OS X, Apache, MySQL/MariaDB, PHP) development, as outlined in my previous posts once you add a database. So then why would you want to use MacPorts? Setting your development environment up in MacPorts isolates the binaries, libraries, and configuration files, completely separate from the existing OS X install (with the exception of startup scripts). You can also tweak the configuration files on your own, apply your own patches, and apply updates that MacPorts may get before Apple pushes them. It will take more time because you'll be compiling everything, but you have all of the control. Read on for how to get things set up.

OS X 10.7 Lion Development: Native MAMP with MySQL installer

Alan Ivey's picture

With the release of Lion, there are some subtle differences to setting up a local MAMP (Mac OS X, Apache, MySQL, PHP) environment compared to Snow Leopard. In an effort to keep this from being overly wordy and just get to the good stuff, we'll dive right in, so read on to get started.

Views Search by Link Module's URL Title: More Views Hacking

Jeremy John's picture

So recently I wanted to filter by URL title, having used it extensively as a text field with an optional link in a site.

The code below is supposed to apply to an exposed Link module field filter in Views. Instead of searching to see if the search string matches the URL, this will match the URL title that was provided.

In the code below, you would replace node_data_{field_publication_author.field_publication_author} with the name of your field, in all places that "field_publication_author" occurs in the below.

Native local development environment in OS X

Apple OS X comes with Apache and PHP built-in but need some tweaking to work. It also does not come with MySQL. Because of this, many developers have chosen to use MacPorts, Homebrew, or MAMP to install new binaries for Apache, PHP, and MySQL. However, doing this means your system would have multiple copies of Apache and PHP on your machine, and could create conflicts depending on how your built-in tools are configured. This tutorial will show you how to get the built-in versions of Apache and PHP running with an easy to install version of MySQL.

Free Zip Code Database Import

Dan's picture

When you need a zip code database for the US you should get it from here
http://www.free-zipcodes.com/
But you shouldn't spend time trying to install all the required perl (sigh) libs needed to import it into MySQL.
Simply create the table structure

CREATE TABLE zipcodes (
       zipcode INT NOT NULL PRIMARY KEY,
       latitude FLOAT(10,8),
       longitude FLOAT(10,8),
       state VARCHAR(2),
       city VARCHAR(128),
       county VARCHAR(128)
);

Then fire up Sequel Pro. File-> Import. Set "Fields terminated by" to || and uncheck "First line contains fields names."

As a bonus Sequel Pro supports ssh tunneling out of the box so you can do it directly to firewalled DBs.

As always make sure you back up your DB first incase of failure.