Leahcim
Leahcim

Reputation: 41929

Using Ruby with MySQL installed via MAMP

I'm a newbie. Here's 3 questions. Thank you.

1) If I have MySQL installed through MAMP on my Mac, can I use the MySQL in Ruby applications (i.e. if I install Ruby of course).

My understanding was that MAMP was a php/mysql package so I wouldn't know how to use Ruby with it. i.e. obviously no PHPMyAdmin for Ruby..

2) Should I do a separate install of MySQL to use with Ruby?

3) If I do need a separate install of MySQL, how do I let the computer know which I am trying to use if I make a database in the command line for example?

Upvotes: 3

Views: 2352

Answers (2)

Brian Wisti
Brian Wisti

Reputation: 159

Using MAMP's MySQL from Ruby not the easiest approach, but I hate to have two of the same database server on one machine. Fortunately, this question has been asked and answered before. Short version: yes, but there will be fiddly bits when you build your mysql gem.

A better solution in the long run might to be using another manager such as Homebrew or MacPorts to manage MySQL and Ruby. I stick with the stock PHP in OS X, but MacPorts has lots of nifty PHP stuff available for the curious.

Upvotes: 2

apneadiving
apneadiving

Reputation: 115521

1) Yes you can, just point to the proper socket. And Ruby is already setup on Mac. So you can have your PhpMyAdmin but I'd go for Sequel Pro.

2) Not mandatory, if you go this way, install brew first and set it up through it, it's really easy.

3) Apps will use sockets or the port you setup. In command line, it would depend on the Path you did setup.

Upvotes: 2

Related Questions