Questions tagged [mysql-error-2002]

Can't connect to local MySQL server through socket

Can't connect to local MySQL server through socket

55 questions
613
votes
91 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
  • 7,508
  • 6
  • 21
  • 24
22
votes
7 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
  • 3,118
  • 6
  • 22
  • 31
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,760
  • 13
  • 44
  • 61
15
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
  • 150
  • 1
  • 1
  • 7
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
  • 24,732
  • 40
  • 139
  • 206
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,954
  • 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
  • 5,102
  • 6
  • 40
  • 67
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,728
  • 13
  • 55
  • 86
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
6
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,441
  • 6
  • 18
  • 29
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
  • 1
  • 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:
seyed ali ziaei
  • 198
  • 3
  • 15
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
  • 14,343
  • 23
  • 76
  • 97
2
votes
2 answers

MySQL remote database server connect failed

I am trying to connect Cakephp 3.x remote database server from my local machine. But it showing below error Error: SQLSTATE[HY000] [2002] No route to host My local database configuration in app.php is look like - 'Datasources' => [ 'default'…
Sumon Sarker
  • 2,707
  • 1
  • 23
  • 36
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
  • 1
  • 2
1
2 3 4