MySQL 8: datadir

Ryan Schmidt ryandesign at
Sun Oct 4 08:03:32 UTC 2020

On Oct 3, 2020, at 12:05, Murray Eisenberg wrote:

> On 3 Oct2020, at 8:00 AM,Andrew Udvare  wrote:
>> Your client is trying to connect
>> /opt/local/var/run/mysql57/mysqld.sock instead of
>> /opt/local/var/run/mysql8/mysqld.sock . Your client is not finding the
>> correct socket path in my.cnf. You can specify which socket to connect
>> to manually:
>> mysql -S /opt/local/var/run/mysql8/mysqld.sock ...
>> If you are running mysql8, does /opt/local/var/run/mysql8/mysqld.sock
>> exist? It may be that your my.cnf says to put it at the old path.
> (a) No, there is no such file /opt/local/var/run/mysql8/mysql.sock ! 
> After loading mysql8-server, the only files in  /opt/local/var/run/mysql8 are .turd_mysql8-server and
> How is that file created?

The server creates the socket file when it starts.

The file presumably contains a process ID number. Is there a process currently running with that process ID number? If yes, is it mysqld? If there is no such process, or if it is not mysqld, try deleting

> (b) Manually specifying the socket gives the same kind of error as before:
> 		sudo port load mysql8-server
> 	--->  Loading startupitem 'mysql8-server' for mysql8-server 
> 	mysql -S /opt/local/var/run/mysql8/mysqld.sock
> 	ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql8/mysqld.sock' (2)

Then I guess there is no such socket file, perhaps because your server has not started.

More information about the macports-users mailing list