Islamic mind

april 1, 2011

MySQL not starting or can’t login ? Mac OS X

Filed under: Uncategorized — majestrooo @ 10:26 f m

This happened to me recently as I switched to a different network. Everything was working and I had not changed any setting whatsoever. But I failed to login to MySQL and got errors like

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

or

STOPPING server from pid file /usr/local/mysql/data/SOMEPIDFILEHERE.pid

I was seriously considering reinstalling but…I *knew* it was all running good before so there must’ve been something else.

The problem was that mysql was configured with ‘localhost’ (fine) but for some reason my hostname was not ‘localhost’ on the new network, instead I had the network’s address.

In Terminal

$ hostname

> somedomain.domain.org

Simply

$ sudo hostname localhost <or whatever you set up with, e.g. 127.0.0.1 before>

Restart mysql

$ sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist

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

Voila it worked after that!

$ mysql -u root [-p]

14 kommentarer »

  1. It is the best time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I want to suggest you some interesting things or tips. Perhaps you can write next articles referring to this article. I wish to read even more things about it!

    Kommentar av Read Full Article — augusti 14, 2012 @ 3:48 e m | Svara

  2. I am genuinely pleased to read this web site posts which carries plenty of useful facts, thanks for
    providing these data.

    Kommentar av Edwin — september 16, 2012 @ 7:39 f m | Svara

  3. This is a great exercise to get your blood pumping and work your calves.
    Samsung hasconfirmedthat the Galaxy S III will be getting Jelly Bean “very soon.
    I say may- because as in all extreme sports while there is certainly a measurable
    amount of skill required there is also a great deal of mental training
    that goes with it.

    Kommentar av Randell — oktober 20, 2012 @ 6:15 e m | Svara

  4. you’re truly a just right webmaster. The site loading velocity is amazing. It kind of feels that you are doing any unique trick. In addition, The contents are masterwork. you’ve done a excellent job on this subject!

    Kommentar av social — november 7, 2012 @ 9:29 e m | Svara

  5. I got so interested in reading the content, it was slowing down my commenting!

    Kommentar av Whitney — januari 23, 2013 @ 4:11 e m | Svara

  6. Right now it appears like Expression Engine is the best blogging platform out there right now.
    (from what I’ve read) Is that what you are using on your blog?

    Kommentar av Arden — mars 28, 2013 @ 1:40 f m | Svara

  7. What a information of un-ambiguity and preserveness of valuable know-how concerning unpredicted emotions.

    Kommentar av Rosetta — april 25, 2013 @ 7:04 e m | Svara

  8. What a data of un-ambiguity and preserveness of valuable familiarity about unexpected feelings.

    Kommentar av dustystem1506.sosblogs.com — juni 4, 2013 @ 6:59 e m | Svara

  9. I used to be recommended this website by means of my
    cousin. I am no longer sure whether or not this submit is written through him as nobody else recognize such special approximately my problem.
    You are wonderful! Thanks!

    Kommentar av phen375 consumer reviews — juni 16, 2013 @ 6:38 e m | Svara

  10. avoid drying

    MySQL not starting or can’t login ? Mac OS X | Islamic mind

    Trackback av avoid drying — september 14, 2014 @ 12:36 e m | Svara

  11. Verlagsgruppe Random House GmbH

    MySQL not starting or can’t login ? Mac OS X | Islamic mind

    Trackback av Verlagsgruppe Random House GmbH — januari 17, 2015 @ 10:38 f m | Svara

  12. reseller hosting murah

    MySQL not starting or can’t login ? Mac OS X | Islamic mind

    Trackback av reseller hosting murah — juni 12, 2015 @ 5:46 f m | Svara

  13. domain murah

    MySQL not starting or can’t login ? Mac OS X | Islamic mind

    Trackback av domain murah — september 23, 2015 @ 12:43 e m | Svara

  14. baju muslim anak keke

    MySQL not starting or can’t login ? Mac OS X | Islamic mind

    Trackback av baju muslim anak keke — september 23, 2015 @ 1:55 e m | Svara


RSS feed for comments on this post. TrackBack URI

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s

Blogga med WordPress.com.

%d bloggare gillar detta: