1

Hi I am very new to all of this. I am trying to prototype an function on my local machine. I am using SQLDeveloper and trying to understand what I would need to do to create a database locally. I'm probably using the wrong language so I will try to be more specific. I don't have access to a server where I can build this database and I would need to do it locally - how would I set up my SQLDeveloper to use part of my hard drive space a server where I can build the database?

1

The easiest thing to do is use Homebrew to install MySQL on your Mac and use that your database.

First install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

With Homebrew installed, you can use it to MySQL. First you'll need git installed:

brew install git

Because we want to make sure we've got all the latest Homebrew recipes next:

brew update

Installing MySQL is now as simple as:

brew install mysql

When that completes you'll have the MySQL database on your system and you can develop against it. All you need to do is start it with:

mysql.server start

If you'd like MySQL to autostart when you start your Mac do:

mkdir -p ~/Library/LaunchAgents
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

You can connect to your MySQL instance using address localhost: 3306.

  • 1
    Just out of curiosity why go through all of this when MySQL has a Mac installer here dev.mysql.com/downloads/mysql. Not being a SQL guy one wonders why you go through Brew just to get MySQL? – Steve Chambers Jun 15 '14 at 21:28
  • 1
    Homebrew offers you insanely good control and compartmentalization over package installs. That one install is kept neatly in its own bucket on disk, easily removed with brew uninstall mysql. It also makes it easy to add lots of other things because, as you'll find out when you start your development work, it doesn't stop at just MySQL. You'll find yourself needing more tools and packages and when you do: you're just a brew install away. – Ian C. Jun 16 '14 at 0:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .