Title: #2002 socket error
Last modified: August 31, 2016

---

# #2002 socket error

 *  Resolved [mike](https://wordpress.org/support/users/mike99wordpress/)
 * (@mike99wordpress)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/)
 * I am quite new at this and am trying to maintain a site on localhost. A couple
   of months ago I found that I could no longer load updates and themes via the 
   dashboard: I was getting an FTP transfer error and to load things manually.
 * I went back to my original tutorial and work my way through it again, but with
   no results. In fact I now get a message “Error establishing a database connection”
   and when trying to log onto the site and when trying to log on to phpadmin I 
   get the message “#2002 – No such file or directory
   The server is not responding(
   or the local server’s socket is not correctly configured).”
 * I have tried reinstalling Mysql and using MAMP reinstalling the entire suite 
   with no results.
 * In fact I no longer see the mysql.sock file or the link to it anymore.
 * Any help or direction would be appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Yogesh Londhe](https://wordpress.org/support/users/yoga1103/)
 * (@yoga1103)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922581)
 * Hi Mike,
 * possibly more than one instance of mysql starting. You could check in ‘Activity
   Monitor’ -> My Processes check for mysqld, quit each instance, may see more than
   one!
 * You may as well post the errors from the mysql_error_log and system.log that 
   will help the members figure out where the problem lies!
 *  Thread Starter [mike](https://wordpress.org/support/users/mike99wordpress/)
 * (@mike99wordpress)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922609)
 * The Activity Monitor gave only one instance of “mysqld”.
 * Here is the mysql_error_log:
 * 160109 08:28:13 mysqld_safe Starting mysqld daemon with databases from /Applications/
   MAMP/db/mysql
    160109 8:28:13 [Warning] Setting lower_case_table_names=2 because
   file system for /Applications/MAMP/db/mysql/ is case insensitive 160109 8:28:
   13 [Note] Plugin ‘FEDERATED’ is disabled. 160109 8:28:13 InnoDB: The InnoDB memory
   heap is disabled 160109 8:28:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
   160109 8:28:13 InnoDB: Compressed tables use zlib 1.2.3 160109 8:28:13 InnoDB:
   Initializing buffer pool, size = 128.0M 160109 8:28:13 InnoDB: Completed initialization
   of buffer pool 160109 8:28:13 InnoDB: highest supported file format is Barracuda.
   160109 8:28:13 InnoDB: Waiting for the background threads to start 160109 8:28:
   14 InnoDB: 5.5.42 started; log sequence number 1595675 160109 8:28:14 [Note] 
   Server hostname (bind-address): ‘0.0.0.0’; port: 8889 160109 8:28:14 [Note] –‘
   0.0.0.0’ resolves to ‘0.0.0.0’; 160109 8:28:14 [Note] Server socket created on
   IP: ‘0.0.0.0’. 160109 8:28:14 [Note] Event Scheduler: Loaded 0 events 160109 
   8:28:14 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections. 
   Version: ‘5.5.42’ socket: ‘/Applications/MAMP/tmp/mysql/mysql.sock’ port: 8889
   Source distribution
 * The Mac system.log is huge.
 * Thanks mike
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922610)
 * The MySQL bind address is incorrect. You’ll need to edit the my.cnf file (my.
   ini on Windows systems) and add the following line in the [mysqld] section:
 *     ```
       bind-address=127.0.0.1
       ```
   
 * If there is already a bind-address line in the file, replace it with the above
   line, but make sure it is in the [mysqld] section.
 * The use of port 8889 for MySQL is unusual (it’s usually 3306), but that may be
   what is required on your system. Check your WordPress wp-config.php file and 
   make sure port 8889 is specified in DB_HOST. The entry should be either **localhost:
   8889** or **127.0.0.1:8889** depending on how MAMP sets up MySQL users.
 *  Thread Starter [mike](https://wordpress.org/support/users/mike99wordpress/)
 * (@mike99wordpress)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922615)
 * Apparently the my.cnf file has not been set up or I cannot find it. There is 
   a sample my.cnf file about 10 levels deep in opt directory. Here is a part of
   it:
 * # /etc/mysql/my.cnf: The global mysql configuration file.
 * # This file can be simultaneously placed in three places:
    # 1. /etc/mysql/my.
   cnf to set global options. # 2. /var/lib/mysql/my.cnf to set server-specific 
   options. # 3. ~/.my.cnf to set user-specific options. # # One can use all long
   options that the program supports. # Run the program with –help to get a list
   of them. # # The following values assume you have at least 32M RAM!
 * [client]
    #password = my_password port = 3306 socket = __PREFIX/var/run/mysqld/
   mysqld.sock etc..
 * At /etc/mysql/ there are two files (which are not mine):
 * fabric.cfg mysql-fabric-doctrine-1.4.0.zip
 * I have changed the wp-config.php file in wordpress to:
    define (‘DB_HOST’, ‘localhost:
   8889’);
 * I have changed the config.inc.php file in phpmyadmin to:
    $cfg[‘Servers’][$i][‘
   host’] = ‘localhost:8889’; $cfg[‘Servers’][$i][‘port’] = ‘8889’; $cfg[‘Servers’][
   $i][‘socket’] = ”; (not changed)
 * ‘localhost’, ‘0.0.0.0’, and ‘127.0.0.1’ all recognize the server.
 * ‘localhost:8889’ gives an error:
 * J���
    5.5.42� ���d_.e6z’M�ÿ÷�€����������/CA^4)px-quy�mysql_native_password
   �!��ÿ„#08S01Got packets out of order
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922619)
 * phpMyAdmin, like pretty much all applications except WordPress, separate the 
   DB host and DB port. Your adding the port to $cfg[‘Servers’][$i][‘host’] will
   always result in an error because the port is specified in its own variable.
 * Did you look for the my.cnf file in the /etc/mysql directory? Most Linux-based
   MySQL installations place my.cnf in the /etc directory with other system configuration
   files; make sure to check there as well.
 * It seems bizarre, but based on what you reported above, you should try setting
   DB_HOST in wp-config.php to **0.0.0.0:8989**.
 *  Thread Starter [mike](https://wordpress.org/support/users/mike99wordpress/)
 * (@mike99wordpress)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922626)
 * Changed the config.inc.php back and tried the 0.0.0.0:8889 as DB_HOST but no 
   joy.
 * I did look in the /etc/mysql directory but what was there were the two files 
   which looked like a sample database(fabric) and a config file for it.
 * I did try [http://localhost:21/~myusername/wordpress/](http://localhost:21/~myusername/wordpress/)
   and got the following error:
    (the original problem had to do with port 21 accepting
   FTP transfers.)
 * This address is restricted
 * This address uses a network port which is normally used for purposes other than
   Web browsing. Firefox has canceled the request for your protection.
 * Would ‘�mysql_native_password�!’ point to a password issue with either of the.
   config files?
 *  [Yogesh Londhe](https://wordpress.org/support/users/yoga1103/)
 * (@yoga1103)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922644)
 * Hi Mike, did you try quitting the mysqld from the Processes and then restarting
   MYSQL from MAMP -> Start Server?
    (for some reason your MYSQL is starting in 
   SAFE mode…)
 * You can make your own my.cnf in “/etc/”
    or in “/Applications/MAMP/conf/”
 * general format is:
 * [client]
    port=3306 socket=/tmp/mysql.sock
 * [mysqld]
    port=3306 socket=/tmp/mysql.sock key_buffer_size=16M max_allowed_packet
   =8M
 * bind-address = 127.0.0.1
 * [mysqldump]
    quick
 * Restart MYSQL after creating the my.cnf file
    Hope that will help!
 *  Thread Starter [mike](https://wordpress.org/support/users/mike99wordpress/)
 * (@mike99wordpress)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922651)
 * from mysql_error_log:
 * 160110 12:13:33 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 3306
   
   160110 12:13:33 [Note] – ‘127.0.0.1’ resolves to ‘127.0.0.1’; 160110 12:160110
   12:13:33 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 330613:33 [
   Note] Server socket created on IP: ‘127.0.0.1’. 160110 12:13:33 [Note] Event 
   Scheduler: Loaded 0 events 160110 12:13:33 [Note] /Applications/MAMP/Library/
   bin/mysqld: ready for connections. Version: ‘5.5.42’ socket: ‘/Applications/MAMP/
   tmp/mysql/mysql.sock’ port: 3306 Source distribution
 * Thank you both! It looks like the my.cnf has been resolved. I will be back I’m
   sure.
 *  [Yogesh Londhe](https://wordpress.org/support/users/yoga1103/)
 * (@yoga1103)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922694)
 * welcome Mike!
 * Happy to help! If the problem is solved, please mark this thread [resolved]
 *  Thread Starter [mike](https://wordpress.org/support/users/mike99wordpress/)
 * (@mike99wordpress)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922708)
 * ..

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘#2002 socket error’ is closed to new replies.

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 10 replies
 * 3 participants
 * Last reply from: [mike](https://wordpress.org/support/users/mike99wordpress/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/2002-socket-error/#post-6922708)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
