Apple recently phased out MySQL in favor of PostgreSQL. There are still valid reasons why we might prefer MySQL, such as compatibility with legacy code.
The maximum version of Mac OS X, OS X, or macOS supported by each G3 and later Mac follows. For complete specs on a particular system, click the name of the Mac. For all Macs that are compatible with a specifc maximum supported version of Mac OS X - courtesy of EveryMac.com's Ultimate Mac Sort - click the OS of interest. The history of macOS, Apple's current Mac operating system originally named Mac OS X until 2012 and then OS X until 2016, began with the company's project to replace its 'classic' Mac OS.That system, up to and including its final release Mac OS 9, was a direct descendant of the operating system Apple had used in its Macintosh computers since their introduction in 1984. Black and White Version, runnable on Mini vMac, Basilisk and SheepShaver, from Mac OS 5.x (included on disk) to 9.2. Program written on 800k floppy disk. Color Version 1.5 runnable on Basilisk with Mac OS 7.x, and possibly others as well. The second disk is only necessary for color and for the talking functionality.
Here are my instructions on how to install MySQL as a permanent service on OS X. These instructions work with or without OS X Server installed. For the most part, installation is straightforward, but read this carefully because there are gotchas where it comes to file permissions.
I’ve tested these instructions several times on OS X 10.11 El Capitan and 10.10 Yosemite. I think these instructions will probably work on 10.8 Mountain Lion and 10.9 Mavericks.
NumberMaze (Mac abandonware from 1988) To date, Macintosh Repository served 1438727 old Mac files, totaling more than 285566.3GB!
You want to back up your MySQL databases before doing a OS X upgrade. The easiest way is to create a mysqldump file. Databases can also be restored from data files, but this is harder and I don’t recommend it.
According to your plan.
Xcode is a dependency for Homebrew, which uses Xcode’s gcc
compiler to compile everything from source. Once you have Xcode installed, you need to install the command line tools for the gcc
compiler to work. From Terminal:
PATH
variable.Open a Terminal window:
Make sure that /usr/local/bin
occurs before /usr/bin.
If they don’t, then you need to change this order. Edit /etc/paths
using vi
or your favorite text editor. I love and use TextWrangler. Close your Terminal window and open a new Terminal window for this change to take effect.
Homebrew is a great package manager for OS X that installs everything in /usr/local/bin
and does not require sudo.
It then symlinks to the expected locations so that the packages can find one another. Because the packages are centralized in the Cellar, they are easily updated and removed.
Follow brew doctor
‘s instructions. brew doctor
usually complains about Xcode. If I’m guessing the error correctly, here is the solution that brew doctor will suggest (assuming OS X 10.10 – note the version since this affects what you will type into Terminal):
Run brew doctor
again. Continue to follow brew doctor
‘s instructions until it tells you that “Your system is ready to brew.”
Homebrew has just installed MySQL to run under the current user, which is not what we want for our server, but we will get to that in a moment. First, we will test the mysqld
service to see if it launches. In newer versions of MySQL, the command to launch the service is $ mysql.server start
.
Using vi
or your favorite text editor, modify the .plist file.
Add these lines within the <dict>
block:
Homebrew’s instructions, which I asked you to ignore, would have installed a LaunchAgent for your current user account, so that the mysqld
service would start whenever you logged in. This would work great for a personal development machine, but it’s not not ideal for a server.
For a server, what we want is for mysqld
to start up at boot time by the root
account. So, we need to make two changes:
/Library/LaunchDaemons
and have the appropriate permissions to be launched by root
./usr/local/var/mysql
must all be owned by _mysql
. You might wonder why the owner must be_mysql
, since the server starts up as root
. This is because whenever mysqld
detects that it is being run as root
, the process steps down to user _mysql
as a security measure. This is typical behavior for services. Apache, for example, steps down to user _www
.Open a Terminal window, and enter:
Important: Now that mysql belongs to root
, do not run the $ mysql.server
command again! Don’t do it. This will result in an aborted launch with permissions errors. You will need to delete the resulting .pid files in /usr/local/var/mysql
before mysqld
will be able to run again, even as root
. Again, don’t do it.
We will reboot the server machine. At boot time, launchctl should load our modified .plist and run mysqld
. We will then run the mysql
command from Terminal to interface with the mysqld
service and verify that it’s running.
After the machine restarts, re-enter Terminal and type:
If the mysql
command fails, then we know that either the LaunchDaemon didn’t kick in, or that mysqld
failed to start successfully. Again, if this happens it is usually because of a permissions issue. To troubleshoot, check the log files at:
A full dump from a recent version of MySQL should successfully restore all databases plus the privilege table, which controls users. If there are problems with the privilege table after restoring, then edit out the privilege table from your mysql dump file, and re-create your users manually using a tool like phpmyadmin
.
I hope this post helped someone. Happy monkeying!
Before installing this upgrade, make sure that your Mac is ready.
macOS Big Sur supports most Mac models introduced in 2013 and later.
View compatible Mac modelsBefore you upgrade, make a complete backup with Time Machine, or store your files in iCloud.
Learn how to back up your MacIf the installer needs more storage space to upgrade, you can free up space using tools that come with your Mac.
Free up storage spaceIf you’re using macOS Mojave or later, choose Apple menu > System Preferences, then click Software Update. If you’re using an earlier macOS, use the App Store instead.
Learn about some of the new features of macOS Big Sur.
Control Center brings favorite controls such as Bluetooth, Wi-Fi, Do Not Disturb, and Sound together in a single place—so you can easily adjust them at any time.
Use Control CenterNotification Center puts notifications and>
Customize your start page, navigate with ease using the new tab bar, and access a new privacy report to see just how Safari protects your privacy as you browse.
Get to know SafariDiscover great places around the world and navigate easier with guides, cycling directions, indoor maps, Look Around, electric vehicle routing, and more.
Send messages to friends and family using new tools that make it easier to keep track of group conversations and give you fun, engaging ways to express yourself.
Use MessagesLearn more on YouTubeUse the expanded editing capabilities in Photos to easily make simple changes and more advanced adjustments to your photos.
Learn how to edit your photosAsk everyone. Our Apple Support Community can help you find answers.
Ask nowAnswer a few questions and we'll help you find a solution.
Get support