Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



OS X Server + Virtual MySQL


25 replies to this topic - - - - -

#1 Mr.XXIV

    Shine bright like Iron Man.

  • 1,182 posts
  • Joined: 30-April 11
  • Location: Stratford, Connecticut
  • OS: OS X Mountain Lion 10.8.2
  • Phone: iPhone 4

Posted 08 January 2013 - 04:33

What's the best way to run MySQL virtually on OS X Mountain Lion? I'm now running the fatest internet Optimum could offer, as I'm replacing Host Gator's server options and I need great performance.


#2 vetthe evn show

    Banned.

  • 5,183 posts
  • Joined: 10-June 02
  • Location: Calgary AB

Posted 09 January 2013 - 00:56

There isn't a particularly great way - none better than anything else you'd get running on Linux or BSD. The basic process is the same as on any other platform: either snag the binary distribution from the website and install it or use a packaging tool like homebrew. In the end you're going to be running the same software so there's no particular reason to prefer one over the other.

"I need great performance" is too vague to offer any better advice. Given that you're seriously considering using a home ISP to make it accessible (I assume, based on your post). You're pretty unlikely to need anything more complicated than a basic installation.

#3 OP Mr.XXIV

    Shine bright like Iron Man.

  • 1,182 posts
  • Joined: 30-April 11
  • Location: Stratford, Connecticut
  • OS: OS X Mountain Lion 10.8.2
  • Phone: iPhone 4

Posted 09 January 2013 - 01:20

View Postthe evn show, on 09 January 2013 - 00:56, said:

There isn't a particularly great way - none better than anything else you'd get running on Linux or BSD. The basic process is the same as on any other platform: either snag the binary distribution from the website and install it or use a packaging tool like homebrew. In the end you're going to be running the same software so there's no particular reason to prefer one over the other.

"I need great performance" is too vague to offer any better advice. Given that you're seriously considering using a home ISP to make it accessible (I assume, based on your post). You're pretty unlikely to need anything more complicated than a basic installation.

Alright. I've done homebrew and so many methods to get MySQL to work locally on OS X, I'm able to load MySQL from my laptop (temporarily, for development purposes til first site re-launch).

Have you seen this error before? I've tried so many solutions on the internet, and nothing has worked on ML 10.8.2.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


#4 hjf288

    Korean Crazy Man!

  • 2,414 posts
  • Joined: 19-April 03
  • Location: United Kingdom

Posted 09 January 2013 - 04:21

http://www.mamp.info/en/index.html

#5 vetthe evn show

    Banned.

  • 5,183 posts
  • Joined: 10-June 02
  • Location: Calgary AB

Posted 09 January 2013 - 05:33

Typically that means MySQL is running or isn't configured to listen on a socket in that location. Does it show up in the process list? Did you follow the instructions after you run brew install mysql? They require adding it to launchd and configuring the root user and that isn't done automatically.

#6 OP Mr.XXIV

    Shine bright like Iron Man.

  • 1,182 posts
  • Joined: 30-April 11
  • Location: Stratford, Connecticut
  • OS: OS X Mountain Lion 10.8.2
  • Phone: iPhone 4

Posted 09 January 2013 - 06:04

View Posthjf288, on 09 January 2013 - 04:21, said:


I might if it comes to that, just to use MySQL.

View Postthe evn show, on 09 January 2013 - 05:33, said:

Typically that means MySQL is running or isn't configured to listen on a socket in that location. Does it show up in the process list? Did you follow the instructions after you run brew install mysql? They require adding it to launchd and configuring the root user and that isn't done automatically.

I tried the native & brewed MySQL several times for a week or two, they both still went through the same exact problem.

There is no other MySQL process running. How would I go about doing that manually?

#7 vetthe evn show

    Banned.

  • 5,183 posts
  • Joined: 10-June 02
  • Location: Calgary AB

Posted 09 January 2013 - 08:35

google for "uninstalling mysql" -- follow the instructions for the version you tried to install. It probably involves nuking /usr/local/mysql and the installation reciepts and maybe something in /var/db. The site you downloaded the binaries from should have a how-to-uninstall guide but it'll vary from one guys version to another so I'm not going to be any more specific.

delete the mysql plist from /library/launchagents if you made it.
brew remove mysql
brew cleanup

make sure you've got updated commandline tools, cmake, and homebrew (if you're using rbenv or rvm roll back to system ruby to ensureyou're not having issues caused by whatever newfangled version you might have installed -- if you've replaced system ruby with something else: may god have mercy on you). ensure brew doctor doesn't identify any problems.

after you run brew install mysql there are other steps you have to follow. Read the directions printed after installation has completed and follow them. If you don't have very specific errors then nobody here can help you. It's like pulling into a garage and saying "my car doesn't work".

You tried for a week or two (really 80 hours of non-stop effort?): what errors did you have? what wasn't working? did you have any success at all? was the program installed and compiled but your application couldn't connect to it? did it launch once and fail to fire up again on boot up? did you follow the instructions to create the root user and initial database?

You need to give more details if you want to get any real help - otherwise I'm going to just give you general directions that aren't very useful.

#8 OP Mr.XXIV

    Shine bright like Iron Man.

  • 1,182 posts
  • Joined: 30-April 11
  • Location: Stratford, Connecticut
  • OS: OS X Mountain Lion 10.8.2
  • Phone: iPhone 4

Posted 09 January 2013 - 10:34

View Postthe evn show, on 09 January 2013 - 08:35, said:

You need to give more details if you want to get any real help - otherwise I'm going to just give you general directions that aren't very useful.

Alright, alright, here's the problem I get when using the mysql_install_db --verbose command given by brew.

130109  5:32:29 [ERROR] /usr/local/opt/mysql/bin/mysqld: unknown variable 'protocol=TCP'


#9 vetthe evn show

    Banned.

  • 5,183 posts
  • Joined: 10-June 02
  • Location: Calgary AB

Posted 09 January 2013 - 16:11

you probably have a my.cnf file left over from an old installation. Homebrew doesn't make one by default so it must be something you've done (either a failed uninstall or maybe you created one trying to make it work). Check the usual locations /etc/my.cnf is typical but you may have put it somewhere else. Remove or rename it. Double check you've cleaned out any old'n'busted installations.

I took a couple of screenshots of my terminal showing how I reproduced your first error and how I figured out the cause and fixed it. Things I type are the colourful lines.

First lets just brew install (I already ran brew doctor and made sure all my software was up to date).
Posted Image

I changed into the mysql directory to see what version gets installed by homebrew.
cd /usr/local/Cellar/mysql/<version here="">/
Version was 5.5.28 when I wrote this.


So far so good. I wonder what happens if you just ignore the instructions and try to start up mysql…
Posted Image
I see, an error like the one you got. Excellent, so I've managed to get the same error message by doing what I suspected OP did. Okay, lets see what's up. The error says it didn't update a file - lets go see what's there…
Posted Image
No permissions? Maybe I need to be root.
Looks like it works. I wonder if I can start mysql as root…
Posted Image
(NOTE: I opened up a second terminal window here, the last command is provided for context)
No dice…
Lets see what's in the error file.
(NOTE: My computer's network name is Lucy - that's how I knew the name of the file to check. Yours will be named after your computer so change accordingly. when in doubt just LS and pick the appropriate file).
Posted Image
Looks like a permissions issue, is really the cause because that's what the error message says. Knowing how to reproduce the error and the likely cause - lets go back and do what homebrew told us 2 minutes ago. Maybe it does something to set correct ownership…
(NOTE: I went back to the first terminal window)
Posted Image
Nope, still getting an error.

Notice the line where I deleted the .err file. I did that so if there were problems starting mysql I could read the entire file and know that the contents covered everything after I had identified the likely cause of the problem. You shouldn't need to do this, but I'd recommend it for the same reason I did it.

Looks like there's still a permissions issue. I bet it has to do with that path from the error log. Lets change the owner to my usual user account (because that's what I'd run MySQL as) and try again (the fuzzy square boxes is just my short user name). Maybe ignoring the brew instructions made MySQL create paths with permissions that the install script doesn't know how to deal with.
Posted Image
That's promising. "Setting up tables" and the word "ok" is the sort of thing I'd expect to see if everything was working. I'm ignoring the "do this stuff to make it start on boot up" instructions because I don't want it to (I'm uninstall mysql because I think postgres is generally a better choice - this would just make extra work for me and doesn't have anything to do with your problem).


Posted Image
This one includes the last line as context along with the full set of instructions for setting up mysql to start up when you reboot. Let's try running mysql.server start.

Looks like fixing permissions was the solution. That might have been broken by not running the mysql_install_db script properly the first time, or it might be an issue with the recipe. Either way - looks like it works and mysql is running.</version>

#10 OP Mr.XXIV

    Shine bright like Iron Man.

  • 1,182 posts
  • Joined: 30-April 11
  • Location: Stratford, Connecticut
  • OS: OS X Mountain Lion 10.8.2
  • Phone: iPhone 4

Posted 09 January 2013 - 17:50

I really appreciate what you've done for me and I finally got it to work! :D Having to cleanup all the old files everywhere on OS X, it managed to install it just right using Homebrew and the methods required. Thanks you!

Also, if you haven't heard of this software, call Sequel Pro. It's amazing! It totally kills the thought of ever having phpMyAdmin in my life! :p

#11 tim_s

    Default

  • 324 posts
  • Joined: 07-January 13
  • OS: OSX (Macbook Pro i7), Windows 7 (Gaming), Gentoo
  • Phone: Samsung Galaxy SIII, iPhone 4s

Posted 09 January 2013 - 18:54

What do you mean "Virtually"?

#12 OP Mr.XXIV

    Shine bright like Iron Man.

  • 1,182 posts
  • Joined: 30-April 11
  • Location: Stratford, Connecticut
  • OS: OS X Mountain Lion 10.8.2
  • Phone: iPhone 4

Posted 09 January 2013 - 18:57

Running another OS at minimum install on a Virtual Box and have SQL running on it. But I have this problem fixed thanks to the evn show, for using it locally. :)

#13 tim_s

    Default

  • 324 posts
  • Joined: 07-January 13
  • OS: OSX (Macbook Pro i7), Windows 7 (Gaming), Gentoo
  • Phone: Samsung Galaxy SIII, iPhone 4s

Posted 09 January 2013 - 19:02

Thanks for the reply - I was curious if you meant virtualization, you are just creating a overhead.

#14 vetthe evn show

    Banned.

  • 5,183 posts
  • Joined: 10-June 02
  • Location: Calgary AB

Posted 09 January 2013 - 19:04

View PostMr.XXIV, on 09 January 2013 - 17:50, said:

Also, if you haven't heard of this software, call Sequel Pro. It's amazing! It totally kills the thought of ever having phpMyAdmin in my life! :p
It's not bad for free software. If you're spending somebody else's money or making a respectable living diddling with databases then get Navicat: it's significantly more powerful.

#15 n_K

    Neowinian Wise One

  • 4,235 posts
  • Joined: 19-March 06
  • Location: here.
  • OS: FreeDOS
  • Phone: Nokia 3315

Posted 09 January 2013 - 19:10

View PostMr.XXIV, on 09 January 2013 - 17:50, said:

Also, if you haven't heard of this software, call Sequel Pro. It's amazing! It totally kills the thought of ever having phpMyAdmin in my life! :p
Erm, what?
phpMyAdmin runs as a web service, if you think businesses or hosting companies will open their mysql database server to remote connections so you can use your program, you are in for a huge surprise.
You might be able to use sequel pro locally on the same PC or network but you will NOT ever see that in the production world because you might as well open your database server to everyone without needing a username or password.