zhaog / aspersa

Automatically exported from code.google.com/p/aspersa
0 stars 0 forks source link

Using --port=N attempts to use a unix domain socket unless --host is also specified #152

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
./mysql-summary --port=N

root@dupdb01:~/percona# ./mysql-summary --port=3313
# Aspersa MySQL Summary Report ###############################
         System time | 2011-07-11 20:04:22 UTC (local TZ: PDT -0700)
# Instances ##################################################
  Port  Data Directory             Socket
  ===== ========================== ======
   3313 /var/lib/mysql/m7          /var/lib/mysql/m7/mysqld.sock
   3319 /var/lib/mysql/m13         /var/lib/mysql/m13/mysqld.sock
ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/lib/mysql/m0/mysqld.sock' (2)
Cannot connect to mysql, please specify command-line options.

but this works:
root@dupdb01:~/percona# ./mysql-summary --port=3313 --host=127.0.0.1
# Aspersa MySQL Summary Report ###############################
         System time | 2011-07-11 20:07:32 UTC (local TZ: PDT -0700)
# Instances ##################################################
  Port  Data Directory             Socket
  ===== ========================== ======
   3313 /var/lib/mysql/m7          /var/lib/mysql/m7/mysqld.sock
   3319 /var/lib/mysql/m13         /var/lib/mysql/m13/mysqld.sock
# Report On Port 3313 ########################################
...
# Processlist ################################################
...

I think host should default to 127.0.0.1 instead of 'localhost' in order to 
resolve this problem.

Original issue reported on code.google.com by greenlion@gmail.com on 11 Jul 2011 at 8:09

GoogleCodeExporter commented 9 years ago
This happens because we just invoke mysql without any arguments other than 
specified, so it's really the same old annoying bug in mysql.  I don't want to 
try to fix it in this tool; that would only cause other problems.  (mysqld not 
listening on 127.0.0.1, for example.)

Original comment by baron.schwartz on 11 Jul 2011 at 9:13