简体   繁体   中英

Mysql connection error in MAC OS X lion

I have tried all the solutions to access mysql that are described before in stackoverflow. When I type mysql and the terminal asks for password,when I type password and press enter it says ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Any idea,this problem making me crazy.

Thanks in advance.

Make sure you're starting the mysql server first. The command is sudo mysqld_safe . Also try looking at my.cnf (likely in /etc/ ) and search for "socket". You may need to change the socket location to /tmp/mysql.sock.

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