Install Mysql Dmg On Mac

In this tutorial, we will guide you on how to install Mysql to Mac. The database is a collection of structured data. It can be any collection of data; from a simple to-do list to an entire database of a firm. Jan 02, 2016  How to Install MySQL on Mac OSX. Connor Leech. So with my computer I am running 10.11 and we want the.dmg file. Download Mac OS X 10.10 (x86, 64-bit), DMG.

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.30 it might be named mysql-5.7.30-osx-10.13-x8664.pkg. The initial wizard introduction screen references the MySQL server version to install. How to Install MySQL on MacOS Introduction. MySQL is an opensource, relational database management system. Its name is the combination of two words that are My + SQL where my is the name of co-founder Michael Widenius's daughter and SQL is the abbreviation of Structured Query Language. MySQL is widely used as a database system in various well-known companies like Google and Facebook. Nov 24, 2013  By the time you read this, there may be a newer version to use instead. Open the archive mysql-5.5.34-osx10.6-x8664.dmg. Install only the mysql-5.5.34-osx10.6-x8664.pkg package. Ignore everything else. MySQL comes with a Preference Pane and Startup Item that are based on technologies that Apple deprecated years ago. If you install the.

13 3 likes 51,829 views Last modified Nov 24, 2013 4:14 PM

This User Tip describes how to download, install, and setup MySQL for use on OS X. It includes an optional section for Perl support. Please read through the entire User Tip before starting.


Requirements:

  1. Basic understanding of Terminal.app and how to run command-line programs.
  2. Basic usage of vi. You can substitute nano if you want.

Optional:

Xcode (with command line tools) is required for the MySQL Perl driver.


Lines in bold are what you will have to type in at the Terminal.

Replace <your local host> with the name of your machine. Ideally, it should be a one-word name with no spaces or punctuation. It just makes life easier.

Replace <your short user name> with your short user name.


Download MySQL from a local mirror. You want the Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive. At the time of writing this User Tip, the current version is 5.5.34. By the time you read this, there may be a newer version to use instead. Open the archive mysql-5.5.34-osx10.6-x86_64.dmg.


Install only the mysql-5.5.34-osx10.6-x86_64.pkg package. Ignore everything else.


MySQL comes with a Preference Pane and Startup Item that are based on technologies that Apple deprecated years ago. If you install the Preference Pane or Startup Item, your MySQL installation could fail at some point in the future when Apple removes support for Startup Items. This was reported to MySQL a long time ago. Until MySQL gets around to fixing this bug, we will have to do it ourselves.


Create a launchd config file for MySQL:

sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist


Use the following content:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>

<plist version='1.0'>

<dict>

<key>KeepAlive</key>

<true/>

<key>Label</key>

<string>com.mysql.mysqld</string>

<key>ProgramArguments</key>

<array>

<string>/usr/local/mysql/bin/mysqld_safe</string>

<string>--user=mysql</string>

</array>

</dict>

</plist>


(if you are new to vi, type 'i' to enter insert mode. Then ⌘-v to paste the above content. Press escape to get back to command mode. Then type 'ZZ' to save and exit.)


The default path for the MySQL socket is not appropriate for MacOS X. Until it is changed, MySQL will not be able to communicate with PHP should you choose to enable that. Let's fix this now.


Create a config file for MySQL that matches the Apple PHP build:

sudo vi /etc/my.cnf


Use the following content:

[client]

socket=/var/mysql/mysql.sock


[mysqld]

socket=/var/mysql/mysql.sock


Start MySQL:

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist


MySQL is now up and running. Don't forget to set a root password and configure your users if this is all you need.


If you need to configure Perl support for MySQL, don't setup a root password just yet. Having no password will make testing the Perl module easier. Keep reading...

You will need Xcode and command line tools for this part.


Mysql for mac

Download the MySQL Perl driver.


Extract the archive with:

tar zxvf DBD-mysql-4.020.tar.gz

Install Mysql For Mac


Move into the directory:

cd DBD-mysql-4.020


First, fix the MySQL client library. (credit)


For Lion, type:

Install Mysql Dmg On Mac

sudo install_name_tool -id /usr/local/mysql-5.5.34-osx10.6-x86_64/lib/libmysqlclient.18.dylib /usr/local/mysql-5.5.34-osx10.6-x86_64/lib/libmysqlclient.18.dylib


Next, build DBD::mysql with:

perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config --testsocket=/var/mysql/mysql.sock --testuser=root

make

make test

sudo make install



Now you can set a root password and configure your users.

2.4.2 Installing MySQL on macOS Using Native Packages

The package is located inside a disk image (.dmg) file that you first need to mount by double-clicking its icon in the Finder. It should then mount the image and display its contents.

Before proceeding with the installation, be sure to stop all running MySQL server instances by using either the MySQL Manager Application (on macOS Server), the preference pane, or mysqladmin shutdown on the command line.

To install MySQL using the package installer:

  1. Download the disk image (.dmg) file (the community version is available here) that contains the MySQL package installer. Double-click the file to mount the disk image and see its contents.

    Figure 2.13 MySQL Package Installer: DMG Contents


  2. 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.30 it might be named mysql-5.7.30-osx-10.13-x86_64.pkg.

  3. The initial wizard introduction screen references the MySQL server version to install. Click to begin the installation.

    Figure 2.14 MySQL Package Installer Wizard: Introduction


  4. The MySQL community edition shows a copy of the relevant GNU General Public License. Click and then to continue.

  5. From the Installation Type page you can either click to execute the installation wizard using all defaults, click to alter which components to install (MySQL server, Preference Pane, Launchd Support -- all enabled by default).

    Although the option is visible, the installation location cannot be changed.

    Figure 2.15 MySQL Package Installer Wizard: Installation Type


    Figure 2.16 MySQL Package Installer Wizard: Customize


  6. Click to begin the installation process.

  7. After a successful installation, the installer displays a window with your temporary root password. This cannot be recovered so you must save this password for the initial login to MySQL. For example:

    Figure 2.17 MySQL Package Installer Wizard: Temporary Root Password


    MySQL expires this temporary root password after the initial login and requires you to create a new password.

  8. Summary is the final step and references a successful and complete MySQL Server installation. the wizard.

    Figure 2.18 MySQL Package Installer Wizard: Summary


MySQL server is now installed, but it is not loaded (or started) by default. Use either launchctl from the command line, or start MySQL by clicking 'Start' using the MySQL preference pane. For additional information, see Section 2.4.3, “Installing a MySQL Launch Daemon”, and Section 2.4.4, “Installing and Using the MySQL Preference Pane”. Use the MySQL Preference Pane or launchd to configure MySQL to automatically start at bootup.

When installing using the package installer, the files are installed into a directory within /usr/local matching the name of the installation version and platform. For example, the installer file mysql-5.7.30-osx10.13-x86_64.dmg installs MySQL into /usr/local/mysql-5.7.30-osx10.13-x86_64/ . The following table shows the layout of the installation directory.

Table 2.6 MySQL Installation Layout on macOS

DirectoryContents of Directory
binmysqld server, client and utility programs
dataLog files, databases
docsHelper documents, like the Release Notes and build information
includeInclude (header) files
libLibraries
manUnix manual pages
mysql-testMySQL test suite
shareMiscellaneous support files, including error messages, sample configuration files, SQL for database installation
support-filesScripts and sample configuration files
/tmp/mysql.sockLocation of the MySQL Unix socket

During the package installer process, a symbolic link from /usr/local/mysql to the version/platform specific directory created during installation will be created automatically.