MySQL 8: datadir

Murray Eisenberg murrayeisenberg at gmail.com
Sat Oct 3 00:36:03 UTC 2020


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??

> On 2 Oct2020, at 6:17 PM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> 
> Andrew Audvare’s separate reply (for some reason not showing yet in my email, although sent before yours), advised:
> 
> 	- stopmysql 5.7 [no problem: I can’t start it!!]
> 
> 	- backup existing 5.7 database
> 
> 	- move my.cnf to "appropriate location" <— not sure what this means! Surely I want it to be in /opt/local/etc/mysql8
> 
> 	- start mysql8
> 
> BUT what about the mysql8 initialization step: do I want to SKIP that, since I already have a mysql 5.7 database to use (i.e., to upgrade automatically)?  Does the initialization do anything else besides creating a new database?
> 
> 
>> On 2 Oct2020, at 5:37 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>> 
>> 
>> 
>> On Oct 2, 2020, at 15:45, Murray Eisenberg wrote:
>> 
>>> Step 6: Database upgrade as necessary
>> 
>> You used to have to upgrade the database manually but according to Oracle's documentation mysql 8.0.16 and later do it for you automatically.
>> 
>> 
>> https://dev.mysql.com/doc/refman/8.0/en/upgrading-what-is-upgraded.html
>> 
>> 
>> That's just one of many pages in the section of their manual on upgrading. There may be other useful information in there for you.
>> 
> 
> ---
> Murray Eisenberg			murrayeisenberg at gmail.com
> 503 King Farm Blvd #101	Home (240)-246-7240
> Rockville, MD 20850-6667	Mobile (413)-427-5334
> 
> 

---
Murray Eisenberg			murrayeisenberg at gmail.com
503 King Farm Blvd #101	Home (240)-246-7240
Rockville, MD 20850-6667	Mobile (413)-427-5334


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20201002/1f58a92d/attachment.htm>


More information about the macports-users mailing list