Questions tagged [mysql-error-2002]

Can't connect to local MySQL server through socket

Can't connect to local MySQL server through socket

54 questions
512
votes
81 answers

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

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…
sushmit sarmah
  • 6,289
  • 5
  • 17
  • 22
22
votes
11 answers

How to Solve the XAMPP 1.7.7 - PHPMyAdmin - MySQL Error #2002 in Ubuntu

I have been through lots of forums and checked various posts on similar topic but non seems to work out for me. I have freshly installed XAMPP 1.7.7 on my Ubuntu 11.10 Operating system. Everything is running except for the phpMyAdmin. Upon…
CompilingCyborg
  • 4,494
  • 12
  • 41
  • 60
18
votes
6 answers

mysql_secure_installation "Can't connect to local MySQL server through socket"

When I am invoking the file mysql_secure_installation I get an error like [mysqk123@InstallZeMo bin]$ ./mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ…
vidyadhar
  • 2,918
  • 6
  • 18
  • 29
14
votes
6 answers

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

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…
Brandon Beeler
  • 141
  • 1
  • 1
  • 6
13
votes
3 answers

CakePHP: No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

I have had a cakephp app running fine on my local machine (mac osx) for a while and then suddently I realise that I can't connect to mysql.sock. I'm getting this error: Warning (2): mysql_connect() [http://php.net/function.mysql-connect]: [2002] No…
iamjonesy
  • 23,004
  • 39
  • 130
  • 203
11
votes
4 answers

Connecting to remote MySQL server using PHP

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…
BenTheDesigner
  • 1,894
  • 3
  • 17
  • 21
9
votes
6 answers

connect to local MySQL server through socket

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I tried everything I found on internet, but cannot solve the problem on Ubuntu 11.04. I tried these things: started mysqld manually using…
Nazar Hussain
  • 4,930
  • 5
  • 35
  • 63
8
votes
7 answers

Can't connect to MySQL on Mac -- missing mysql.sock file

I installed MySQL on my Mac OS 10.6 about a week ago, and, after some playing around, got it to work just fine. It integrated with python MySQLdb and I also got Sequel Pro to connect to the database. However, php wouldn't access the server. Even…
tchaymore
  • 3,508
  • 12
  • 44
  • 84
7
votes
2 answers

ERROR 2002 (HY000) while using brewed mysql

I was using MAMP and have removed it completely from my MAC OS. Post this, I installed mysql5.7 using brew Added mysql path to zshrc / bash profile Started mysql service using brew services start mysql@5.7 Now when I try to access mysql on command…
Rizwan Dhuka
  • 146
  • 4
5
votes
7 answers

MySQL - Mac - Error 2002 - Can't connect to local... through socket

I had MySQL running fine on my Mac till earlier today when I installed homebrew and also updated my Path. When I try to run mysql from my ternimal window now, I get the following error: ERROR 2002 (HY000): Can't connect to local MySQL server through…
Sohrab Hejazi
  • 1,291
  • 6
  • 16
  • 27
2
votes
2 answers

Docker can't connect to local MySQL server through socket

I'm a newbie to docker and I'm facing a strange error. When I run docker run --name some-mysql-5 -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret mysql:latest followed by docker exec -ti containerid bash mysql -uroot -psecret mysql works fine and…
config.err
  • 41
  • 6
2
votes
0 answers

Error MySQL connection access denied

I can't connect to MySQL database. I try to connect to MySQL but meet this error. I change port & host but nothing happens. Access Denied:
2
votes
2 answers

Reinstalling MySQL on Ubuntu

MySQL is broken on my Ubuntu OS. It throws the following error: mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I wasn't able to repair it. So I want to reinstall MySQL. But I…
mlzboy
  • 13,296
  • 23
  • 70
  • 94
2
votes
2 answers

Can't connect to '/var/run/mysqld/mysqld.sock'

This is my first post here, so I hope I do everything right and don't forget any important info. I'm glad for any hints, because I'm running out of ideas (if I ever had any ;)). I am (or was) running owncloud on Raspbian Jessie (so I guess basically…
Fo Tastisch
  • 21
  • 1
  • 2
2
votes
0 answers

Zend MySQL PDO and remote host fatal error SQLSTATE[HY000] [2002]

At my local zend project I've got such problem, when I try to connect to remote mysql server. Here application.ini part: resources.db.adapter = PDO_MYSQL resources.db.params.host = www.my-site.com resources.db.params.port =…
1
2 3 4