MySQL is a relational database management system. MySQL is the widely used database server in the world. This tutorial helps you to install MySQL database server on macOS Sierra 10.12 and High Sierra 10.13 and other supported versions using Homebrew. I've moved to a new machine and installing MySQL is turning out to be quite an issue (the last time I installed it on a mac it was quite seamless). I used two approaches to install MySQL: brew and the offical installer. Brew: I started with brew install mysql. This installed the latest version of MySQL. How to download and install MySQL for MAC OS X 2019 - Duration: 14:26. Techie Mum 7,070 views. MySql Installation On mac Mojave - Duration: 6:10. CodeHunter 2,827 views. Double-click the MySQL installer package from the disk. It is named according to the version of MySQL you have downloaded. For example, for MySQL server 5.7.33 it might be named mysql-5.7.33-osx-10.13-x8664.pkg. The initial wizard introduction screen references the MySQL server version to install.
Global Nav Open Menu Global Nav Close Menu; Apple; Shopping Bag +.
16 13 likes 31,779 views Last modified Jan 31, 2019 11:25 AM
Here is my definitive guide to getting a local web server running on OS X 10.14 “Mojave”. This is meant to be a development platform so that you can build and test your sites locally, then deploy to an internet server. This User Tip only contains instructions for configuring the Apache server, PHP module, and Perl module. I have another User Tip for installing and configuring MySQL and email servers.
Note: This user tip is specific to macOS 10.14 “Mojave”. Pay attention to your OS version. There have been significant changes since earlier versions of macOS.Another note: These instructions apply to the client versions of OS X, not Server. Server does a few specific tricks really well and is a good choice for those. For things like database, web, and mail services, I have found it easier to just setup the client OS version manually.
Requirements:
- Basic understanding of Terminal.app and how to run command-line programs.
- Basic understanding of web servers.
- Basic usage of vi. You can substitute nano if you want.
Optional: Xcode is required for adding PHP modules.
Lines in bold are what you will have to type in. Lines in bold courier should be typed at the Terminal.Replace <your short user name> with your short user name.
Here goes... Enjoy!
To get started, edit the Apache configuration file as root:
sudo vi /etc/apache2/httpd.conf
Enable PHP by uncommenting line 177, changing:
#LoadModule php7_module libexec/apache2/libphp7.so
to
LoadModule php7_module libexec/apache2/libphp7.so
(If you aren't familiar with vi, go to line 177 by typing '177G' (without the quotes). Then just press 'x' over the '#' character to delete it. Then type ':w!' to save, or just 'ZZ' to save and quit. Don't do that yet though. More changes are still needed.)
If you want to run Perl scripts, you will have to do something similar:
Enable Perl by uncommenting line 178, changing:
#LoadModule perl_module libexec/apache2/mod_perl.so
to
LoadModule perl_module libexec/apache2/mod_perl.so
Enable personal websites by uncommenting the following at line 174:
#LoadModule userdir_module libexec/apache2/mod_userdir.so
to
LoadModule userdir_module libexec/apache2/mod_userdir.so
and do the same at line 511:
#Include /private/etc/apache2/extra/httpd-userdir.conf
to
Include /private/etc/apache2/extra/httpd-userdir.conf
Now save and quit.
Open the file you just enabled above with:
sudo vi /etc/apache2/extra/httpd-userdir.conf
and uncomment the following at line 16:
#Include /private/etc/apache2/users/*.conf
to
Include /private/etc/apache2/users/*.conf
Save and exit.
Lion and later versions no longer create personal web sites by default. If you already had a Sites folder in Snow Leopard, it should still be there. To create one manually, enter the following:
mkdir ~/Sites
echo '<html><body><h1>My site works</h1></body></html>' > ~/Sites/index.html.en
While you are in /etc/apache2, double-check to make sure you have a user config file. It should exist at the path: /etc/apache2/users/<your short user name>.conf.
That file may not exist and if you upgrade from an older version, you may still not have it. It does appear to be created when you create a new user. If that file doesn't exist, you will need to create it with:
sudo vi /etc/apache2/users/<your short user name>.conf
Use the following as the content:
<Directory '/Users/<your short user name>/Sites/'>
AddLanguage en .en
AddHandler perl-script .pl
PerlHandler ModPerl::Registry
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride None
Require host localhost
</Directory>
Now you are ready to turn on Apache itself. But first, do a sanity check. Sometimes copying and pasting from an internet forum can insert invisible, invalid characters into config files. Check your configuration by running the following command in the Terminal:
apachectl configtest
If this command returns 'Syntax OK' then you are ready to go. It may also print a warning saying 'httpd: Could not reliably determine the server's fully qualified domain name'. You could fix this by setting the ServerName directive in /etc/apache2/httpd.conf and adding a matching entry into /etc/hosts. But for a development server, you don't need to do anything. You can just ignore that warning. You can safely ignore other warnings too.
Turn on the Apache httpd service by running the following command in the Terminal:
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
In Safari, navigate to your web site with the following address:
http://localhost/
It should say:
It works!
Now try your user home directory:
http://localhost/~<your short user name>
It should say:
My site works
Now try PHP. Create a PHP info file with:
echo '<?php echo phpinfo(); ?>' > ~/Sites/info.php
And test it by entering the following into Safari's address bar:
http://localhost/~<your short user name>/info.php
You should see your PHP configuration information.
To test Perl, try something similar. Create a Perl test file with:
echo 'print $ENV{MOD_PERL} . qq{n};' > ~/Sites/info.pl
And test it by entering the following into Safari's address bar:
http://localhost/~<your short user name>/info.pl
You should see the string 'mod_perl/2.0.9'.
If you want to setup MySQL, see my User Tip on Installing MySQL.
If you want to add modules to PHP, I suggest the following site. I can't explain it any better.
If you want to make further changes to your Apache system or user config files, you will need to restart the Apache server with:
sudo apachectl graceful
Check compatibility
Mysql For Mac Os
You can upgrade to macOS Mojave from OS X Mountain Lion or later on any of the following Mac models. Your Mac also needs at least 2GB of memory and 12.5GB of available storage space, or up to 18.5GB of storage space when upgrading from OS X Yosemite or earlier.
MacBook introduced in 2015 or later
MacBook Air introduced in 2012 or later
MacBook Pro introduced in 2012 or later
Mac mini introduced in 2012 or later
iMac introduced in 2012 or later
iMac Pro (all models)
Mac Pro introduced in 2013, plus mid-2010 or mid-2012 models with a recommended Metal-capable graphics card.
MacBook Air introduced in 2012 or later
MacBook Pro introduced in 2012 or later
Mac mini introduced in 2012 or later
iMac introduced in 2012 or later
iMac Pro (all models)
Mac Pro introduced in 2013, plus mid-2010 or mid-2012 models with a recommended Metal-capable graphics card.
To find your Mac model, memory, storage space, and macOS version, choose About This Mac from the Apple menu . If your Mac isn't compatible with macOS Mojave, the installer will let you know.
Make a backup
Before installing any upgrade, it’s a good idea to back up your Mac. Time Machine makes it simple, and other backup methods are also available. Learn how to back up your Mac.
Get connected
It takes time to download and install macOS, so make sure that you have a reliable Internet connection. If you're using a Mac notebook computer, plug it into AC power.
Download macOS Mojave
For the strongest security and latest features, find out whether you can upgrade to macOS Catalina, the latest version of the Mac operating system.
Install Mysql Mac Mojave
If you still need macOS Mojave, use this App Store link: Get macOS Mojave.
Begin installation
After downloading, the installer opens automatically.
Click Continue and follow the onscreen instructions. You might find it easiest to begin installation in the evening so that it can complete overnight, if needed.
If the installer asks for permission to install a helper tool, enter the administrator name and password that you use to log in to your Mac, then click Add Helper.
Allow installation to complete
Download Mysql For Mac
Please allow installation to complete without putting your Mac to sleep or closing its lid. Your Mac might restart, show a progress bar, or show a blank screen several times as it installs both macOS and related updates to your Mac firmware.
Learn more
Mysql For Mac
Install Mysql Mac
- If you have hardware or software that isn't compatible with Mojave, you might be able to install an earlier macOS, such as High Sierra, Sierra, or El Capitan.
- macOS Mojave won't install on top of a later version of macOS, but you can erase your disk first or install on another disk.
- You can use macOS Recovery to reinstall macOS.