List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 11 1999 9:03pm
Subject:RE: Moving the DATADIR gives socket error
View as plain text  
>>>>> "Terry" == Terry Paddy <terry@stripped> writes:

Terry> Hi Jani,
Terry> Thanks for your comments. I'm not sure what wrong, but if I change the data
Terry> path I get
Terry> "ERROR 2002: Can't connect to local MySQL server through socket
Terry> '/var/lib/mysql/mysql.sock' (111)"

Terry> If I comment out the datadir in my.cnf, then MySql works but points to the
Terry> original data. I've tried your suggestions
>>> please use mysql --socket=/var/lib/mysql/mysql.sock to connect or define
Terry> it in your .my.cnf file. <<

Terry> and I've read the section 18.2.2 'Can't connect to [local] MySQL server
Terry> error' and unfortunately I've got nowhere.

Terry> I've copied the relevant part of my.cnf below

Terry> ********* my.cnf *************************
Terry> # This will be passed to all mysql clients
Terry> [client]
Terry> #password	= my_password
Terry> port		= 3306
Terry> socket	= /var/lib/mysql/mysql.sock

Terry> # Here is entries for some specific programs
Terry> # The following values assume you have at least 32M ram

Terry> # The MySQL server
Terry> [mysqld]
Terry> port		= 3306
Terry> socket	= /var/lib/mysql/mysql.sock
Terry> datadir     =/home/mysql
Terry> *******************************************

Terry> Any other suggestions or pointers will be *greatly* appreciated.
Terry> Thanks...


The above should work.  The socket 'should' be independent of the data 

Does the socket '/var/lib/mysql/mysql.sock' exists after you have
changed the data directory?

You can check how mysqld is really started by doing:

libexec/mysqld --print-defaults

You can also try to do:

mysqladmin -h 'your hostname' variables

This will show the name of the socket the MySQL server uses.

Please try to collect as much information you can about this problem;
We need this to be able to find out what's wrong!


Moving the DATADIR gives socket errorTerry Paddy1 Oct
  • Moving the DATADIR gives socket errorJani Tolonen2 Oct
    • RE: Moving the DATADIR gives socket errorTerry Paddy11 Oct
      • RE: Moving the DATADIR gives socket errorMichael Widenius11 Oct