error 2002 can't connect to local mysql server through socket

Code:
100804 12:19:45 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 12:19:45 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 12:19:45 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
100804 12:19:45  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
100804 12:19:45  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
100804 12:19:45  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
100804 12:19:46 InnoDB 1.1.1 started; log sequence number 0
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 12:19:46 [ERROR] Aborting

100804 12:19:46  InnoDB: Starting shutdown...
100804 12:19:51  InnoDB: Shutdown completed; log sequence number 1595675
100804 12:19:51 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 12:19:51 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100804 14:01:04 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 14:01:05 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 14:01:05 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
100804 14:01:05  InnoDB: highest supported file format is Barracuda.
100804 14:01:06 InnoDB 1.1.1 started; log sequence number 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 14:01:06 [ERROR] Aborting

100804 14:01:06  InnoDB: Starting shutdown...
100804 14:01:11  InnoDB: Shutdown completed; log sequence number 1595675
100804 14:01:11 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 14:01:11 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100804 14:04:49 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 14:04:49 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 14:04:49 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
100804 14:04:49  InnoDB: highest supported file format is Barracuda.
100804 14:04:49 InnoDB 1.1.1 started; log sequence number 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 14:04:49 [ERROR] Aborting

100804 14:04:49  InnoDB: Starting shutdown...
100804 14:04:54  InnoDB: Shutdown completed; log sequence number 1595675
100804 14:04:54 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 14:04:54 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100804 15:05:05 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 15:05:05 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 15:05:05 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
100804 15:05:05  InnoDB: highest supported file format is Barracuda.
100804 15:05:05 InnoDB 1.1.1 started; log sequence number 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 15:05:05 [ERROR] Aborting

100804 15:05:05  InnoDB: Starting shutdown...
100804 15:05:11  InnoDB: Shutdown completed; log sequence number 1595675
100804 15:05:11 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 15:05:11 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100805 12:32:37 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100805 12:32:37 [Note] Plugin 'FEDERATED' is disabled.
100805 12:32:37  InnoDB: Started; log sequence number 0 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100805 12:32:37 [ERROR] Aborting

100805 12:32:37  InnoDB: Starting shutdown...
100805 12:32:43  InnoDB: Shutdown completed; log sequence number 0 1595675
100805 12:32:43 [Note] /usr/local/libexec/mysqld: Shutdown complete

100805 12:32:43 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
Code:
/usr/local/libexec/mysqld --version Ver 5.1.48 for portbld-freebsd8.0 on i386 (FreeBSD port: mysql-server-5.1.48)
 
Code:
100804 12:19:45 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 12:19:45 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 12:19:45 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
100804 12:19:45  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
100804 12:19:45  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
100804 12:19:45  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
100804 12:19:46 InnoDB 1.1.1 started; log sequence number 0
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 12:19:46 [ERROR] Aborting

100804 12:19:46  InnoDB: Starting shutdown...
100804 12:19:51  InnoDB: Shutdown completed; log sequence number 1595675
100804 12:19:51 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 12:19:51 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100804 14:01:04 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 14:01:05 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 14:01:05 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
100804 14:01:05  InnoDB: highest supported file format is Barracuda.
100804 14:01:06 InnoDB 1.1.1 started; log sequence number 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 14:01:06 [ERROR] Aborting

100804 14:01:06  InnoDB: Starting shutdown...
100804 14:01:11  InnoDB: Shutdown completed; log sequence number 1595675
100804 14:01:11 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 14:01:11 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100804 14:04:49 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 14:04:49 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 14:04:49 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
100804 14:04:49  InnoDB: highest supported file format is Barracuda.
100804 14:04:49 InnoDB 1.1.1 started; log sequence number 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 14:04:49 [ERROR] Aborting

100804 14:04:49  InnoDB: Starting shutdown...
100804 14:04:54  InnoDB: Shutdown completed; log sequence number 1595675
100804 14:04:54 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 14:04:54 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100804 15:05:05 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100804 15:05:05 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100804 15:05:05 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
100804 15:05:05  InnoDB: highest supported file format is Barracuda.
100804 15:05:05 InnoDB 1.1.1 started; log sequence number 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100804 15:05:05 [ERROR] Aborting

100804 15:05:05  InnoDB: Starting shutdown...
100804 15:05:11  InnoDB: Shutdown completed; log sequence number 1595675
100804 15:05:11 [Note] /usr/local/libexec/mysqld: Shutdown complete

100804 15:05:11 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
100805 12:32:37 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100805 12:32:37 [Note] Plugin 'FEDERATED' is disabled.
100805 12:32:37  InnoDB: Started; log sequence number 0 1595675
/usr/local/libexec/mysqld: Too many arguments (first extra is '.pid').
Use --verbose --help to get a list of available options
100805 12:32:37 [ERROR] Aborting

100805 12:32:37  InnoDB: Starting shutdown...
100805 12:32:43  InnoDB: Shutdown completed; log sequence number 0 1595675
100805 12:32:43 [Note] /usr/local/libexec/mysqld: Shutdown complete

100805 12:32:43 mysqld_safe mysqld from pid file /var/db/mysql/machinehostname ended
 
Lets get drastical

# rm -rf /var/db/mysql/*

Remove everyting in /etc/rc.conf too, it's a mess.
Put this in:
Code:
hostname="machinehostname"
ifconfig_bge0="DHCP"
mysql_enable="YES"

Everything else is either on by default (so you don't need to set it) or is in there multiple times.

Reboot. After the reboot check if mysql is running: $ pgrep -lf mysql
If it isn't have a look at /var/db/mysql/`hostname`.err and/or /var/log/messages.
 
And do _not_, as you have done up until now, use machinehostname as your hostname, but the actual hostname of you hardware.
 
Hi,

I got the same problem on Windows 7 64 bit. I tried to hack but no results. It took two weeks from my life. Truly fed up with Windows 7. Please, help me, guys. I got these results in the MySQL log:

Code:
110618 16:29:12 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
110618 16:29:12  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110618 16:29:13  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110618 16:29:13  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110618 16:29:14  InnoDB: Started; log sequence number 0 0
110618 16:29:14 [Note] Event Scheduler: Loaded 0 events
110618 16:29:14 [Note] wampmysqld: ready for connections.
Version: '5.1.36-community-log'  socket: ''  port: 3306  MySQL Community Server (GPL)
110618 16:36:42 [Note] wampmysqld: Normal shutdown

110618 16:36:42 [Note] Event Scheduler: Purging the queue. 0 events
110618 16:36:42  InnoDB: Starting shutdown...
110618 16:36:44  InnoDB: Shutdown completed; log sequence number 0 46409
110618 16:36:44 [Warning] Forcing shutdown of 1 plugins
110618 16:36:44 [Note] wampmysqld: Shutdown complete

110618 17:02:30 [Note] Plugin 'FEDERATED' is disabled.
110618 17:02:31  InnoDB: Started; log sequence number 0 46409
110618 17:02:31 [Note] Event Scheduler: Loaded 0 events
110618 17:02:31 [Note] wampmysqld: ready for connections.
Version: '5.1.36-community-log'  socket: ''  port: 3306  MySQL Community Server (GPL)
 
Back
Top