There are several ways to install MySQL on your Mac, for example:

  • compile from source
  • use the Homebrew package manager (http://brew.sh)
  • use a nifty script courtesy of Mac Mini Vault (http://git.io/eUx7rg)
  • or use the dedicated MySQL installer package (recommended)

Rapidweaver 7.2.2 download for mac. I recommend the dedicated installer because it’s the only package that will also add a convenient Preference Pane for starting and stopping the service.

In this article I’ll focus on the latter, and I’ll also talk you through how to add MySQL to the PATH variable and how to secure MySQL to keep the evildoers away from your server.

How to install MySQL on Mac OS X El Capitan November 2, 2015 MySQL El Capitan, macOS, Yosemite Jay Versluis There are several ways to install MySQL on your Mac, for example. Installing MySQL on your own Mac. There are several different ways to install MySQL on Mac OS X. We have provided links to the most common installation methods for Mac OS X. Using the official.pkg installer. This is the fastest method for installing MySQL on your Mac, but only available for Intel processors.

These instructions will work on Yosemite and El Capitan (I’ve tested it on both systems – in fact that’s part of why I’m writing this, so that I can remember for next time).

Downloading and installing MySQL

You’ll find several packages at the MySQL website in the downloads section: http://dev.mysql.com/downloads/mysql/

If that link isn’t working, head over to http://mysql.com and find the Downloads section. Hunt for something called the Community GPL Downloads, and for a section called MySQL Community Server. That’s the Open Source version of MySQL. Pick a platform from the drop down menu (Mac OS X).

Again there are several versions you can download. You’ll probably want the DMG Archive equivalent to the version of OS X you’real running (this screenshot was taken in November 2015, things may have changed since then):

Double-click the file and you’ll be guided through a standard OS X installation. When the installer has finished, MySQL is installed on your system – but of course it’s neither running nor configured yet. We’ll take care of that in the next step.

Take a look under (Apple Logo) – System Preferences and see if you can find the MySQL Preference Pane. If you see that, all is well.

Starting and stopping MySQL

Start MySQL using the preference pane I’ve just mentioned. Tick the box that reads “automatically start MySQL server on startup” if you want that behaviour.

Minecraft forge installer download for mac

If you ever want to start/stop MySQL, this is the most convenient place to do it on your Mac. At times however, that fancy button is greyed out, which means that the Launch Daemon isn’t running. Should this happen, start the daemon via the command line manually, like this:

Try typing mysqladmin now and see what happens. You should see a long list of options. If you see a “command not found” error instead, something didn’t work out with the alias or PATH tweak.

Securing MySQL

MySQL comes with a handy script that will secure your installation. It lets you set a root user password, (dis-)allow remote access and remove test databases and users. I highly recommend you run it before using MySQL, especially when you’re deploying on production servers.

The following command will only work if the above has been added to the PATH variable, this won’t work with aliases:

Alternatively, you can call the script with the full path:

Using MySQL on your Mac

With all the above in place, you’re good to use MySQL on your Mac the usual way. You’ll find all the gory details at http://mysql.com.

A couple of things to know:

MySQL on OS X doesn’t like the value “localhost”. Instead, use 127.0.0.1 (don’t ask me why). WordPress for example won’t connect when you use localhost as your DB_HOST value.

If you’re looking for a graphical admin tool, there’s a SUPERB tool available for your Mac that exclusively deals with administering MySQL databases and users: it’s called Sequel Pro: http://sequelpro.com. It’s also open source and it’s simply phenomenal: it allows you to administer local and remote databases and user accounts, and it’s a native OS X app.

Rather than creating users and databases from the command line (which of course works fine), Sequel Pro will be of great help to you.

Just one more thing…

MySQL will install itself listening to its default port of 3306.

However, if you have previously installed MySQL via another method (Homebrew for example), and you decided that you really wanted that swanky Preference Pane, then the Mac installer will go ahead and install MySQL again – but it’s clever enough to notice that port 3306 is already being used by something else.

In which case, the default port for the Mac installation will become the next available higher port, for example 3307. It won’t uninstall the previous MySQL, or amend it.

Sadly the OS X installation does not use a configuration file (such as /etc/my.cnf ), but there’s a workaround that’s described here: http://stackoverflow.com/questions/5320424/change-port-for-mysql-on-mac

With all that said, enjoy!

Further Reading

Related

MySql is a very popular relational sql database server software. It is widely used in huge of websites as the database server. This article will tell you how to install MySql database server and GUI client tool on MacOS to make MySql database management easily.

1. Install MySql Database Server On Mac.

  1. Download MySql Server community version for MacOS.
  2. Click the downloaded dmg file to open the MySql server installer package.
  3. Click Next button in the wizard dialog until go to the Change Install Location… dialog, then click Install button to install it.
  4. After installation, it will display Configure MySQL Server dialog, input root user’s password. And click Finish button to complete MySql server installation.
  5. Now MySql server has been installed successfully.

2. Start, Stop, Configure MySql Server.

  1. Open MacOS System Preferences.
  2. Click MySQL button to open MySQL configuration dialog. Then you can start, stop and configure MySQL server in it.

3. Manage MySQL Database With MySQL Workbench.

  1. Download MySQL Workbench community version.
  2. Click the downloaded dmg file to install it.
  3. Open MySQL workbench application.
  4. Connect to the local MySQL database server.
  5. Click the Create a new schema in the connected server button to create a database.
  6. Input mysql database name and select database character set and collation. Click Apply button to create the database.
  7. Right click the Tables item under dev2qa database then click Create Table… menu item to create table.
  8. Input table name at top text box. Then click table row to add one column, input column name, select datatype and other column options(Primary Key, Not Null, Unique, Auto Increment, Binary etc).
  9. Right click user_account table, click Select Rows – Limit 1000 menu item to open edit table data dialog in right panel to insert data into the table.

4. Create MySQL User and Assign Privileges To The User.

Java Installer Download For Mac

  1. Click Users and Privileges menu item in left MySQL workbench panel.
  2. Click Add Account button at the bottom of right panel.
  3. Input user name and password in the new panel.
  4. Click Administrative Roles tab to select related roles and assign them to the newly created MySQL user.
  5. Click Schema Privileges tab to assign MySQL database (schema) privileges to the user by click Add Entry… button. You can select all database, or special database either by matching string pattern or exactly string match.
  6. Then select desired Object Rights, DDL Rights or Other Rights checkboxes at bottom, then click Apply button to apply the selected privileges to the created user.

Free Downloads For Mac

5. Create Example User Account Table.

In our mysql jdbc examples, we always use a table user_account, so we should create this table use MySQL workbench. Below is the table DDL sql code, you can also run it to create this table.

Music Download For Mac

To execute below DDL code, just click Create a new SQL tab for executing queries button ( ) at mysql workbench tool bar top left corner to open a sql command execute window, and then copy below code into it. Then click execute button(the first lightning icon ) at the top tool bar of the sql window to execute the code.