search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

2 answers
Q&A MySQL connection not working: 2002 No such file or directory
MySQL connection not working: 2002 No such file or directory
P粉422227023 2024-02-25 14:08:33 Views 561
PHP

0

I'm trying to set up WordPress. I have Apache and MySQL running and the accounts and databases are set up. I try to establish a simple connection:

I always get this:

Error: 2002 - No such file or Table of contents

What file or directory is it talking about?

I'm using OS X Snow Leopard, using the built-in Apache. I installed MySQL using x86_64 dmg.

Update: I discovered that the socket is located at /tmp/mysql.sock, so in php.ini I replaced all occurrences of the wrong path with that.

Your Answer
submit

2 answers
0

If you are using Linux: The path to the mysql.sock file is wrong. This is usually because you are using (LAMPP) XAMPP and it is not in /tmp/mysql.sock

Open the php.ini file and find this line:

mysql.default_socket

Then do it

mysql.default_socket = /path/to/mysql.sock
2024-02-26 11:58:23

submit

0

I had a similar problem and was able to resolve my mysql issue by using 127.0.0.1 instead of localhost.

This probably means something is wrong with my hosting setup, but I need this quick fix right now.

2024-02-26 13:21:41

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use