This is a tutorial on how to set up Apache 2.4, PHP 5.5, and MySQL 5.6 on Mac OS X 10.10 Yosemite.This tutorial is a good reference for PHP developers who want to set up a local MAMP development. OS X 10.10, aka Yosemite, sports a more modern look and bridges the gap between Apple's desktop and mobile devices. The new Continuity helps you hand off tasks from iPhone to iPad to Mac, but that. Download the 'Mac OS X 10.9 (x86, 64-bit), DMG Archive' from mysql.com and install the pkg. Open the pref pane and start the MySQL Server. Update the path by editing /.bashprofile and add. MySQL is a free relational database, now owned by Oracle. Installing MySQL. Here are instructions for setting up a 64-bit MySQL on Mac OS X, tested August 2010 with 10.6.4 Snow Leopard (MySQL 5.1.49), October 2012 with 10.8.2 Mountain Lion (MySQL 5.6.17), April 2014 on 10.9.2 Mavericks (MySQL 5.6.25), Oct 2015 on 10.10.5 Yosemite (MySQL 5.6.25).
I upgraded my laptop to Yosemite (Mac OS X Version 10.10.2). I like the simpler graphics. Far as I can tell so far, all my applications work properly but I had problems with MySQLWorkbench which was crashing when I attempted to start the local MySQL server.
A few years ago we started writing scripts that help install MySQL on OS X. In OS X 10.6 and prior, MySQL was included with the “Server” version of the OS. With the move to Server.app, Apple removed MySQL. Which coincidentally is not long after Oracle acquired Sun which included MySQL. MySQL had a GUI installer for OS X that worked well, but was missing a few things that made it ready to work with Apache/PHP out of the box. Our installer took care of those items as well as set the root password randomly. The default install has root enabled without a password. We took the installer one step forward by adding features for installing a modified MySQL configuration file, and Sequel Pro (a GUI front end for MySQL). Then Yosemite was released recently and our installer had a few issues.
The upgrade to Yosemite did spring cleaning to OS X. There were long outstanding bugs that were resolved and deprecated commands/functions that were finally removed. MySQL had been using a StartupItem configuration to allow an end user to easily set MySQL to start on boot. This setup has been out of date since the OS X 10.4 days. Yosemite will not autostart via a StartupItem. You can easily write a Launchd plist file to auto-start MySQL, but the nice MySQL preference pane that allows a user to turn MySQL off and on again would not function. There is a supporting script from MySQL that handles the start/stop/status functions for the preference pane. What we did in our latest installer is created a Launchd plist that looks for networking to start up, and when ready, use the MySQL support script to start MySQL. This allows MySQL to start on boot, and still retains all use of the MySQL Preference pane.
We also specifically set the MySQL installer to not even attempt to install the Startup Items. Our latest version also should fix the ‘pid could not be found/error not running’ error that some people experienced in the past! (Edit: maybe not every pid error scenario)
The code is all up on github – We have a page that describes each script and provides the important links: http://code.macminivault.com/
To install MySQL copy and paste this into Terminal (Be sure to read the READ ME first):
bash <(curl -Ls http://git.io/eUx7rg)
The great thing about hosting our scripts on github, is that others can easily follow our development and provide input or code that we may merge into our codebase. Star/Watch our Mac-Scripts repo and be sure to let us know of any issues or requests on Github!
Update: We have an updated post that shows how to install MySQL 5.7 on macOS Sierra.
Upgraded to Yosemite , great . now lets see how to setup Apache webserver with PHP and MySQL . unlike 10.7 Lion or 10.6 there is no prefrence pane option to turn on Apache . but don’t worry MacOSX Yosemite comes with Apache and you can turn on it using Terminal . Okay lets see how to setup Apache PHP and MySQL setup in Mac OS X Yosemite .
setup apache
open terminal and type
now open your favourite browser and browse to http://localhost
you will see default apache page
you will see default apache page
Lets setup user-dir for per user
I am going to use
nano
in this guide feel free to use any of your favourite editor .- Enable
mod_authz_core, mod_authz_host, mod_userdir
andmod_userdir.so
modules
Uncomment These Three Modules For Now ( Remove “#” sign from the starting of line if “#” is present )
You can dump list of all Loaded Modules using
sudo apachectl -M
command .Then Navigate to bottom of the file , and uncomment following line
Download Mysql For Mac Os X Yosemite
then open
/etc/apache2/extra/httpd-userdir.conf
and uncomment following line
Okay Now Setup your user.conf
Now Create
Sites
Folder in your Home DirectorNow test apache config using
Now Create a File inside Sites Directory Name it
Enter Some Plain HTML and save that
index.html
Enter Some Plain HTML and save that
Now Let’s Test Apache Configuration
Yosemite Download Free
then restart apache
then open browser and browse to http://localhost/~yourusername , Note that “~” tilde in url
Install Mysql Mac
your will see something like this
Setup PHP
and uncomment
and test apache config using
then create a file in your Sites Directory
apachectl -t
then create a file in your Sites Directory
then enter simple
phpinfo()
in index.phpand browse to http://localhost/~username/index.php
you will see phpinfo page
you will see phpinfo page
setup MySQL
Download MySQL (Download DMG ) : http://dev.mysql.com/downloads/mysql/
Install that Like another Package of MacOSX there is nothing tricky , install prefPane ( included in DMG )
adding mysql in $PATH
above command will create
.bash_login
file in your home directory and it will add MySQL in PATHrestart your terminal and start mysql from PrefrencePane
okay now open terminal and type
All Done Now MySQL is set up
Now You Have Working APACHE PHP AND MYSQL
ScreenCast
Mysql For Mac
happy Coding ?