Mac OS X Lion and MySQL Startup

After installing Mac OS X Lion and updated my PHP extensions, as well as installing the newest MySQL, I found that when I tried to use MySQL, it wasn’t working. Seems that MySQL wouldn’t start up do to owner settings.

MySQL was previously installed in Snow Leopard with file ownership set to mysql:wheel, which worked fine in Snow Leopard. In Lion it failed to start.

In Terminal, run the following:

sudo chown -R mysql:mysql data

After running this, and starting up MySQL in the System Preferences panel, everything worked again.

Notice, that your “data” folder is the MySQL data folder where it stores the database files. My is located at “/usr/local/mysql-data/data” so that I don’t have to worry about upgrades and moving the folder. Your location may vary.

Hope this helps anyone else.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Mac OS X Lion Upgrade PHP Extensions Tutorial: ImageMagick and More.

After upgrading my Mac OS X Snow Leopard to Mac OS X Lion, I noticed that some of my PHP extensions that I had compiled to work with the Apple PHP 5.3.6 binary had been removed. Some, not all. Which I assume is due to them having been compiled 4-way binary compatible (PowerPC and i386/x86_64). Since Lion no longer supports PowerPC, it seems that all the extension files that had PowerPC in them were removed. Xdebug was still there, but all the rest were gone. Below is the process I performed to get everything back.

Step 1:
Download and install MacPorts 2.0.0 for Mac OS X Lion.

Step 2:
In Terminal, run the following commands. The first one may take a while to update the binaries as it compiles them.

sudo port upgrade outdated
sudo port uninstall inactive

Step 3:
Download and install MySQL 5 (currently at mysql-5.5.15-osx10.6-x86_64 as of this writing) for Mac OS X.

You may not need to install MySQL, though I chose to do so as I wanted to update to the 64bit System Preferences panel, since I was running an earlier version of MySQL 5 previously.

Step 4:
I also noticed that my /etc/php.ini file was moved to /etc.php.applesaved and no longer called any of my PHP extensions I had set.

In Terminal, run the following:

sudo cp /etc/php.ini.applesaved /etc/php.ini
sudo apachectl graceful

Step 5:
Continue on to my PHP extensions tutorial for Snow Leopard and begin with Step 5 if you don’t have ImageMagick installed, Step 6 if you do.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Mac OS X Snow Leopard, PHP, MySQL, SVN, Xcode, and Me…

With minimal effort, I was able to get the PHP bundled with Snow Leopard to use the PHP extensions that I had compiled for xdebug, imagick, and magickwand to run in 64bit mode.

Snow Leopard comes bundled with Apache 2.2.11, PHP 5.3.0, and SVN 1.6.2.

I upgraded my MySQL install from 5.0.77 to 5.1.37 and then moved my data folder to another location to help keep things sane using the /etc/my.cnf file.

I installed the Xcode from the Snow Leopard CD and downloaded the iPhone SDK 3.1 Beta 3 for Snow Leopard.  Slightly different interface, but I welcome the changes.

So now, instead of using external packages for SVN and PHP (Entropy), now I’m using the prepackaged bundled software.  I did have to reconfigure my svn connection in Apache as it got toasted in the upgrade to Snow Leopard.  It wasn’t a problem though as it was only a few lines.

Now I can sleep good, I hope.

VN:F [1.9.22_1171]
Rating: 7.3/10 (4 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 4 votes)

MySQL for Mac OS X Leopard PowerPC

After installing Entropy PHP for my Mac mini running Leopard with a PowerPC chip, I then installed MySQL 5.0.51. Executed MySQL from the command line in Terminal, and then Terminal become unstable and unhappy with me. Without notice I realized I installed the x86 binary version, and it caused a bit of trouble with illegal exceptions, forcing me to have to reboot and install MySQL 5.0.51 Mac OS X 10.4 (PowerPC, 32-bit). Everything worked fine running the Tiger version of MySQL 5 for PowerPC.

Now all my databases and websites are safely stored on 2 Mac systems.

Maybe someday I’ll place the Mac mini in the basement of the office and make it a web server for some truly productive sites I might develop in the future. Even though that might bottleneck the whole office internet system since they use four cable modems load balanced together instead of using a T3 connection, or even better a pair of T3 connections.

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)