mysql-error-2002

Error #2002 Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

吃可爱长大的小学妹 提交于 2019-11-26 14:33:25
问题 I'm running MAMP. It has been working fine up until yesterday. I haven't been able to find anything that helps so far. But here is my problem: As the title states I'm receiving the following error: error #2002 "Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)" which, I have noticed, seems to be a pretty common error when I search for it. Anyway, When I cd to tmp/mysql and ls -laxo the only thing that shows up besides the ./ and ../ directories

Connecting to remote MySQL server using PHP

谁说我不能喝 提交于 2019-11-26 04:25:48
问题 I am attempting to connect to a remote MySQL server from my local machine virtualhost using the following code: $conn = mysql_connect(\"$dbhost\", \"$dbuser\", \"$dbpass\") or die(mysql_error()); mysql_select_db($dbname, $conn) or die(mysql_error()); My problem is that I am unable to connect locally, receiving the error: Can\'t connect to MySQL server on \'xxx.xxx.xxx.xxx\' (10060) This is not the case when I upload the same PHP file to the server. I am able to query the database with no

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

孤街浪徒 提交于 2019-11-25 22:39:28
问题 I installed LAMP on Ubuntu 12.04 LTS (Precise Pangolin) and then set root password on phpMyAdmin. I forgot the password and now I am unable to login. When I try to change password through terminal I get: ERROR 2002 (HY000): Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysqld.sock\' (2) How can I fix this? I am unable to open LAMP, uninstall it or reinstall it. 回答1: I once had this problem and solved it by installing mysql-server , so make sure that you have installed