<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I have an existing MacPorts mysql57 installation (but mysql is not currently working: the dreaded PID file cannot be found error).<div class="">—> I have an existing mysql57 datadir, namely, as specified in /opt/local/etc/mysql57/my.cnf:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>datadir = /Users/murray/Databases/mysql/data<br class=""><div class=""><br class=""></div><div class="">So I’m trying anew, now with mysql8. I’ve installed mysql8-server and mysql8. And issued command:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>sudo port select mysql mysql8</div><div class=""><br class=""></div><div class="">But I don’t want to lose the old database in that mysql587 datadir location!</div><div class=""><br class=""></div><div class="">So what exactly do I do?</div><div class=""><br class=""></div><div class="">According to <a href="https://trac.macports.org/wiki/howto/MySQL" class="">https://trac.macports.org/wiki/howto/MySQL</a>, the steps at this point would be:</div><div class=""><br class=""></div><div class="">Step 2: Create the database</div><div class=""><pre class="wiki" style="background-color: rgb(247, 247, 247); border: 1px solid rgb(215, 215, 215); box-shadow: rgb(238, 238, 238) 0px 0px 1em; border-top-left-radius: 0.3em; border-top-right-radius: 0.3em; border-bottom-right-radius: 0.3em; border-bottom-left-radius: 0.3em; margin: 1em 1.75em; padding: 0.25em; overflow: auto; font-size: 13px;">sudo /opt/local/lib/mysql8/bin/mysqld --initialize --user=_mysql</pre><div class="">And chown for the db, run, and log directories for mysql8.</div><div class=""><br class=""></div><div class="">BUT…do I really want to do this Step 2 if I already have a database from mysql57??</div><div class=""><br class=""></div><div class="">(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!)</div><div class=""><br class=""></div><div class="">Step 3: Start MySQL.</div><div class=""><br class=""></div><div class="">But that will start it using the new database. Very confusing: I want to use the old one, updated to MySQL 8.</div><div class=""><br class=""></div><div class="">Step 4: Set the MySQL password  (OK, I guess)</div><div class=""><br class=""></div><div class="">Step 5 (Optional security configuration)</div><div class=""><br class=""></div><div class="">Step 6: Database upgrade as necessary</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>This is very confusing, too! I already have that old mysql57 database, in a non-default datadir location.</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>I have not yet customized my.cnf — that step seems to come after Step 6.</div><div class=""><br class=""></div><div class="">—> 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.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">
---<br class="">Murray Eisenberg<span class="Apple-tab-span" style="white-space: pre;">                       </span><a href="mailto:murrayeisenberg@gmail.com" class="">murrayeisenberg@gmail.com</a><br class="">503 King Farm Blvd #101<span class="Apple-tab-span" style="white-space: pre;">     </span>Home (240)-246-7240<br class="">Rockville, MD 20850-6667<span class="Apple-tab-span" style="white-space: pre;">  </span>Mobile (413)-427-5334<br class=""><br class="">

</div>

<br class=""></div></div></body></html>