Which password on mysql upgrade?

Murray Eisenberg murrayeisenberg at gmail.com
Sat Oct 28 14:45:22 UTC 2017


As I indicated, I am _not_ using launchd to manage mysql.server (as I do not want to keep the server running, but rather run only on occasion that I need it).

If I understand correctly, “mysql.server start” calls mysql_safe, which in turn calls mysqld.

So is it not correct if I want to manage the mysql server in strictly a manual way, starting and stopping it when I want to, then "mysql.server start" and “mysql.server.stop” is an appropriate way to do it?



> On 28 Oct2017, at 5:30 AM, Ryan Schmidt <ryandesign at macports.org> wrote:
> 
> 
> 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.
> 

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




More information about the macports-users mailing list