MySQL 8: datadir

Murray Eisenberg murrayeisenberg at gmail.com
Fri Oct 2 20:45:49 UTC 2020


I have an existing MacPorts mysql57 installation (but mysql is not currently working: the dreaded PID file cannot be found error).
—> I have an existing mysql57 datadir, namely, as specified in /opt/local/etc/mysql57/my.cnf:

	datadir = /Users/murray/Databases/mysql/data

So I’m trying anew, now with mysql8. I’ve installed mysql8-server and mysql8. And issued command:

	sudo port select mysql mysql8

But I don’t want to lose the old database in that mysql587 datadir location!

So what exactly do I do?

According to https://trac.macports.org/wiki/howto/MySQL <https://trac.macports.org/wiki/howto/MySQL>, the steps at this point would be:

Step 2: Create the database
sudo /opt/local/lib/mysql8/bin/mysqld --initialize --user=_mysql
And chown for the db, run, and log directories for mysql8.

BUT…do I really want to do this Step 2 if I already have a database from mysql57??

(The macports page above has a link on mysql-data-directory-location, but that seems to be changing the location after doing the initialize, yet I already have an existing mysql57 datadir populated. Very confusing!)

Step 3: Start MySQL.

But that will start it using the new database. Very confusing: I want to use the old one, updated to MySQL 8.

Step 4: Set the MySQL password  (OK, I guess)

Step 5 (Optional security configuration)

Step 6: Database upgrade as necessary

	This is very confusing, too! I already have that old mysql57 database, in a non-default datadir location.
	I have not yet customized my.cnf — that step seems to come after Step 6.

—> Please advise just what to do, so that I can use mysql8 with the old, non-default datadir but with the database there updated to MySQL 8.


---
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/54ffcff4/attachment.htm>


More information about the macports-users mailing list