Bug #70997 MYSQLD IS NOT STARTING WITH DEFAULT SOCKET IF USER NOT PASSED OPTION
Submitted: 25 Nov 2013 9:49 Modified: 25 Nov 2013 13:55
Reporter: Ramana Yeruva Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.34 OS:Other (Debian)
Assigned to: CPU Architecture:Any
Tags: Debian

[25 Nov 2013 9:49] Ramana Yeruva
Description:
install mysql-advanced-5.6.15-debian6.0-i686.deb
create database with default settings
start server with default settings(don't pass socket)
connect with mysql using default settings(don't pass socket)
connect fails

How to repeat:
lroot@vitro73:/export/home/tmp/qauser/ford/5.6.15# dpkg -i
mysql-advanced-5.6.15-debian6.0-i686.deb
lroot@vitro73:/export/home/tmp/qauser/ford/5.6.15# cd
/opt/mysql/server-5.6/bin/
lroot@vitro73:/opt/mysql/server-5.6/bin# ../scripts/mysql_install_db
--no-defaults --datadir=/opt/data
lroot@vitro73:/opt/mysql/server-5.6/bin# ./mysqld --no-defaults
--datadir=/opt/data -uroot &
[1] 31340
lroot@vitro73:/opt/mysql/server-5.6/bin# 2013-11-21 10:35:36 0 [Warning]
TIMESTAMP with implicit DEFAULT value is deprecated. Please use
--explicit_defaults_for_timestamp server option (see documentation for more
details).
2013-11-21 10:35:36 31340 [Note] Plugin 'FEDERATED' is disabled.
2013-11-21 10:35:36 31340 [Note] InnoDB: The InnoDB memory heap is disabled
2013-11-21 10:35:36 31340 [Note] InnoDB: Mutexes and rw_locks use GCC atomic
builtins
2013-11-21 10:35:36 31340 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-11-21 10:35:36 31340 [Note] InnoDB: Using Linux native AIO
2013-11-21 10:35:36 31340 [Note] InnoDB: Not using CPU crc32 instructions
2013-11-21 10:35:36 31340 [Note] InnoDB: Initializing buffer pool, size =
128.0M
2013-11-21 10:35:36 31340 [Note] InnoDB: Completed initialization of buffer
pool
2013-11-21 10:35:36 31340 [Note] InnoDB: Highest supported file format is
Barracuda.
2013-11-21 10:35:36 31340 [Note] InnoDB: 128 rollback segment(s) are active.
2013-11-21 10:35:36 31340 [Note] InnoDB: Waiting for purge to start
2013-11-21 10:35:36 31340 [Note] InnoDB: 5.6.15 started; log sequence number
1625987
2013-11-21 10:35:36 31340 [Warning] No existing UUID has been found, so we
assume that this is the first time that this server has been started.
Generating a new UUID: 46be1c65-5290-11e3-9d3e-0021f6100022.
2013-11-21 10:35:36 31340 [Note] RSA private key file not found:
/opt/data//private_key.pem. Some authentication plugins will not work.
2013-11-21 10:35:36 31340 [Note] RSA public key file not found:
/opt/data//public_key.pem. Some authentication plugins will not work.
2013-11-21 10:35:36 31340 [Note] Server hostname (bind-address): '*'; port:
3306
2013-11-21 10:35:36 31340 [Note] IPv6 is available.
2013-11-21 10:35:36 31340 [Note]   - '::' resolves to '::';
2013-11-21 10:35:36 31340 [Note] Server socket created on IP: '::'.
2013-11-21 10:35:36 31340 [Note] Event Scheduler: Loaded 0 events
2013-11-21 10:35:36 31340 [Note] ./mysqld: ready for connections.
Version: '5.6.15-enterprise-commercial-advanced'  socket: '/tmp/mysql.sock'
port: 3306  MySQL Enterprise Server - Advanced Edition (Commercial)
 
here server started with /tmp/mysql.sock by default which means client(s)
also should be able to connect with default socket but not
 
lroot@vitro73:/opt/mysql/server-5.6/bin# ./mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)

Suggested fix:
--------------
lroot@vitro73:/opt/mysql/server-5.6/bin# ./mysqld --verbose --help | grep
sock
socket
/var/run/mysqld/mysqld.sock
 
as per options server should start with /var/run/mysqld/mysqld.sock as socket
but it is not started like that..
[25 Nov 2013 10:37] Hartmut Holzgraefe
"./mysqld --no-defaults ..."

so you requested the mysqld server to start without reading the global my.cnf defaults file, and so it uses the compile time default for the socket path

While here 

  # ./mysqld --verbose --help | grep sock
  socket
  /var/run/mysqld/mysqld.sock

mysqld *did* read the global "my.cnf" (in the
absence of --no-defaults)
[25 Nov 2013 13:55] MySQL Verification Team
Thank you for the bug report. Please read Hartmut explanation. Thanks.