简体   繁体   中英

MySQL Error on Mac Lion 10.7

I am trying to make mysql run on mac so I can make it work with rails 3. I installed the mysql*.dmg file from the official website, and I have also added this in my ".bashrc" file:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
PATH=$PATH:/usr/local/mysql/bin

Now I have created a /tmp/mysql.lock file, changed its permission and I still get this error when I am trying to run mysql:

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

Any help installing mysql on Lion?

That's because MySQL is probably creating the socket file somewhere else. Use

mysqladmin variables

in the terminal to find out the exact location and use it in your database.yaml .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM