0

I have XAMPP installed, and I want to use mysql.sock file for my rails app.

Now, when I start the MySQL server (from xampp control panel), it starts, I see it's PID, I can access the mysql command line etc, but I can't find the mysql.sock file anywhere.

I'm running under Windows 7.

Any idea what might could have gone wrong?

EDIT: Here's the error log, from mysql_error.log - this is what I see when i start MySQL from xampp control panel:

2015-07-16 13:51:27 4088 [Note] Plugin 'FEDERATED' is disabled.
2015-07-16 13:51:27 16f0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-07-16 13:51:27 4088 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-16 13:51:27 4088 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-16 13:51:27 4088 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-07-16 13:51:27 4088 [Note] InnoDB: Memory barrier is not used
2015-07-16 13:51:27 4088 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-16 13:51:27 4088 [Note] InnoDB: Not using CPU crc32 instructions
2015-07-16 13:51:27 4088 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2015-07-16 13:51:27 4088 [Note] InnoDB: Completed initialization of buffer pool
2015-07-16 13:51:27 4088 [Note] InnoDB: Highest supported file format is Barracuda.
2015-07-16 13:51:27 4088 [Note] InnoDB: The log sequence numbers 1665558 and 1665558 in ibdata files do not match the log sequence number 1666100 in the ib_logfiles!
2015-07-16 13:51:27 4088 [Note] InnoDB: Database was not shutdown normally!
2015-07-16 13:51:27 4088 [Note] InnoDB: Starting crash recovery.
2015-07-16 13:51:27 4088 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-07-16 13:51:27 4088 [Note] InnoDB: Restoring possible half-written data pages 
2015-07-16 13:51:27 4088 [Note] InnoDB: from the doublewrite buffer...
2015-07-16 13:51:28 4088 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-16 13:51:28 4088 [Note] InnoDB: Waiting for purge to start
2015-07-16 13:51:28 4088 [Note] InnoDB: 5.6.24 started; log sequence number 1666100
2015-07-16 13:51:28 4088 [Note] Server hostname (bind-address): '*'; port: 3306
2015-07-16 13:51:28 4088 [Note] IPv6 is available.
2015-07-16 13:51:28 4088 [Note]   - '::' resolves to '::';
2015-07-16 13:51:28 4088 [Note] Server socket created on IP: '::'.
2015-07-16 13:51:28 4088 [Note] Event Scheduler: Loaded 0 events
2015-07-16 13:51:28 4088 [Note] c:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.6.24'  socket: ''  port: 3306  MySQL Community Server (GPL)
idjuradj
  • 101
  • 1
  • 2
  • Have you searched in the default locations? You could try specifying it manually when you start the daemon, i.e. "--socket=C:...." – Vérace Jul 16 '15 at 11:51
  • Yes, I searched the whole xampp folder, and whole C:\ partition.

    How can I check the statuses of mysqld and mysql? P.S I updated the question with error log content. Maybe that can be of help.

    – idjuradj Jul 16 '15 at 12:01
  • I just took a look at my error.log (this is for Linux) - and at the very last line, where you have "socket: ''" - i.e. socket is blank, I have a filename - so something is wrong. In your my.ini, in both the [mysqld] and the [client] sections, specify a socket thus - socket = C:/www/tmp/mysql.sock (or wherever). This should do the trick for you. – Vérace Jul 16 '15 at 12:11
  • Here's my my.ini: http://pastebin.com/stxkX1TM

    I have socket path specified? Can you compare it to your my.ini, is there something missing?

    – idjuradj Jul 16 '15 at 12:31

1 Answers1

1

I have BAD NEWS and VERY BAD NEWS

BAD NEWS

Connecting to MySQL via the socket file is a Unix-only protocol

This option explicitly specifies a protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. For example, connections on Unix to localhost are made using a Unix socket file by default:

shell> mysql --host=localhost

To force a TCP/IP connection to be used instead, specify a --protocol option:

shell> mysql --host=localhost --protocol=TCP

The following table shows the permissible --protocol option values and indicates the platforms on which each value may be used. The values are not case sensitive.

--protocol Value   Connection Protocol                              Operating Systems
TCP                TCP/IP connection to local or remote server      All
SOCKET             Unix socket file connection to local server      Unix only
PIPE               Named-pipe connection to local or remote server  Windows only
MEMORY             Shared-memory connection to local server         Windows only

Therefore, MySQL for Windows does not create a socket file and you cannot connect with one.

The closest protocol you want to use like a socket file is the named pipe

On Windows, you can force a MySQL client to use a named-pipe connection by specifying the --pipe or --protocol=PIPE option, or by specifying . (period) as the host name. If named-pipe connections are not enabled, an error occurs. Use the --socket option to specify the name of the pipe if you do not want to use the default pipe name.

VERY BAD NEWS

I have an old posts where I mentioned that certain builds of mysqld.exe supported named pipes but are no longer being distributed :

As I said in How to check/change MySQL named pipe settings?

Do yourself a favor and do not enable it since there is so little documentation on using this protocol. It was originally meant for Windows NT (Not There).

SUGGESTION

Connect with TCP/IP instead of trying to work with named pipes

RolandoMySQLDBA
  • 182,700
  • 33
  • 317
  • 520
  • I had a suspicion that that was the case - even Googled for it, but found a my.ini suggestion instead. That'll teach me to properly research my input! Thanks for pointing that out. – Vérace Jul 16 '15 at 18:37