Possible mysql.sock problem | ERROR 2002 (HY000)

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Jan 3 13:44:39 UTC 2010


jaymax wrote:

> Direct start from script /usr/local/etc/rc.d/mysql-server start fails also
> 
> And running /usr/local/bin/mysql ==>
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/usr/tmp/mysql.sock' (2)
> 

There's a $mysql_socket rc.conf variable you need to set as well.

> Settings in rc.conf
> 	mysql_enable="YES"
> 	mysql_limits="YES"
> 	mysql_dbdir="/disk02/db/mysql/DATA"
> 	mysql_args=""
        mysql_socket="/usr/tmp/mysql.sock"

(Although if /usr/tmp is set to mode 1777, what's the benefit of using that
location rather than the default /tmp/mysql.sock ?)
 
> In my.cnf file
> 	[client] 
> 	socket=/usr/tmp/mysql.sock
> 	[mysqld] 
> 	socket=/usr/tmp/mysql.sock

Is this the only my.cnf file on the system?  There are several places
where MySQL will pick up a my.cnf file: directly from the mysql_dbdir
or /usr/local/etc/my.cnf [The rc.d/mysql-server script automatically
adds ${mysql_dbdir}/my.cnf to the list of locations]

Judging by the complaints about 'update log no longer supported' I'm
guessing that there is somewhere a my.cnf or a .my.cnf file filled with
configuration settings appropriate to a much earlier version of MySQL.
A good strategy is to grab one of the sample .cnf files from
/usr/local/share/mysql (according to the capabilities of your server)
copy that into ${mysql_dbdir}/my.cnf and edit to make any local 
customizations.

	Cheers,

	Matthew 

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20100103/f84dd22a/signature.pgp


More information about the freebsd-questions mailing list