Which password on mysql upgrade?

Ryan Schmidt ryandesign at macports.org
Sat Oct 28 09:30:03 UTC 2017


On Oct 27, 2017, at 12:15, Murray Eisenberg wrote:

> Think I solved it.
> 
> First, one and only one password is needed, namely, that for mysql. (Assuming I’ve run sudo recently before the timeout that would prompt for a new macOS password.)
> 
> Second, even though the MacPorts docs for MySQL in Step 6 gives...
> 
> sudo port unload mysql57-server
> …before
> sudo /opt/local/lib/mysql57/bin/mysql_upgrade -u root -p
> 
> …it seems that one nevertheless does have to start the mysql server in order to cause a socket to exist and allow to mysql_upgrade execute.
> 
> And, in fact, man mysql_upgrade includes the explicit instructions:
> 
>    To use mysql_upgrade, make sure that the server is running. 
> 
> That worked for me, and execution of mysql_upgrade ended with message:
> 
>    Upgrade process completed successfully.
> 
> 
> Question remaining: Am I just misunderstanding what starting/loading and stopping/unloading the mysql-server means? Rather than “load” and “unload”, I always use: 
> 
>     sudo /opt/local/share/mysql57/support-files/mysql.server start
> 
>   sudo /opt/local/share/mysql57/support-files/mysql.server stop
> 
> (Actually, via aliases defined in ~/.profile, I actually use much shorter commands “mysqlstart” and “mysqlstop”.


"sudo port load" and "sudo port unload" are shortcuts for using launchctl to tell launchd load and unload the server plists.

If launchd is managing your server, it will start and stop it for you. If you manually intervene and use "mysql.server stop" to stop a server launchd was managing, launchd will probably start it right back up for you, because one of launchd's purposes is to make sure server processes are always running. So don't interfere with a server managed by launchd. If you want to stop a server launchd started, tell launchd to stop it by unloading the plist, not by using "mysql.server stop" or another method.

If the wiki is wrong, please fix it.



More information about the macports-users mailing list