Mysql – How does one change the default socket used by thesqladmin

MySQLmysqladmin

How does one change the default socket used by mysqladmin?

I don't see a section for [mysqladmin] in /etc/my.cnf.

It tries by default to connect to /tmp/mysql.sock, however, this is not the socket that my MySQL server uses, so I get the error:

error: 'Can't connect to local MySQL server through 
    socket '/tmp/mysql.sock' 

I know you can specify the socket at the command line, such as:

mysqladmin --socket='/some/other/path/mysql.sock'

How do I change the default socket used by mysqladmin so I don't have to specify my non-standard path each time?

Best Answer

Better yet, make that section [client] to cover for any mysql client call. as this will only work for mysqladmin

Related Question