MySQL 8: datadir

Ryan Schmidt ryandesign at macports.org
Sat Oct 3 01:05:33 UTC 2020



On Oct 2, 2020, at 19:36, Murray Eisenberg wrote:

> Assuming I do _not_ want to initialize the database, given that I want to use an existing (MySQL 5.7) database with the newly installed MySQL8, I loaded mysql8-server, then tried to connect to it:
> 
> 		mysql
> 	ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql57/mysqld.sock' (2)
> 
> Note:
> 
> 		sudo port select --show mysql
> 	The currently selected version for 'mysql' is 'mysql8’.
> 
> So the error from trying to execute ‘mysql’ is surprising! Here’s my configuration file /opt/local/etc/mysql8/my.cnf :
> 
> 	# Use default MacPorts settings
> 	!include /opt/local/etc/mysql8/macports-default.cnf
> 
> 	[mysqld]
> 		datadir = /Users/murray/Databases/mysql/data
> 	port = 3306
> 	socket = /opt/local/var/run/mysql8/mysqld.sock
> 	pid-file = /opt/local/var/run/mysqld/mysqld.pid
> 
> 	sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
> 
> 	[client]
> 	socket = /opt/local/var/run/mysql8/mysqld.sock
> 
> What’s wrong??

I'm not sure. Your questions are probably not specific to MacPorts; they're more MySQL-specific, so you might have more luck asking in a MySQL support venue.

What does "which mysql" say? What about "mysql --version"?

Could there be a my.cnf file in /Users/murray/Databases/mysql/data that's overriding your settings?



More information about the macports-users mailing list