Which password on mysql upgrade?
murrayeisenberg at gmail.com
Fri Oct 27 17:15:59 UTC 2017
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
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”.
Or is there an error now in the Step 6 instructions?
> On 27 Oct2017, at 12:34 PM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> Typo in my post, sorry.
> As the cited MacPorts doc for MySQL specify, I’m actually issuing the command...
> sudo /opt/local/lib/mysql57/bin/mysql_upgrade -u root -p
> .. with the prefix sudo to the mysql_upgrade command, there do seem to be two passwords involved, one for the sudo and a second for mysql_upgrade.
> (I do understand that MySQL knows nothing about my OS password!)
>> On 27 Oct2017, at 12:28 PM, Marius Schamschula <mschamschula at gmail.com <mailto:mschamschula at gmail.com>> wrote:
>> This is the mysql root password. MySQL has no knowledge of your OS password.
>> Marius Schamschula
>>> On Oct 27, 2017, at 11:26 AM, Murray Eisenberg <murrayeisenberg at gmail.com <mailto:murrayeisenberg at gmail.com>> wrote:
>>> I’m upgrading msql56 -> mysql57.
>>> Step 6 in Documentation at https://trac.macports.org/wiki/howto/MySQL <https://trac.macports.org/wiki/howto/MySQL> says:
>>> "If the database exists from a previous installation, you may need to upgrade.”
>>> After unloading mysql57-server, as recommended there I execute:
>>> mysql_upgrade /opt/local/lib/mysql57/bin/mysql_upgrade -u root -p
>>> After Question: which password should be entered in response to the prompt: my macOS admin account’s password or the mysql root’s password?
>>> Or, if both are required, which do I enter first?
>>> If I just enter my macOS admin account’s password, I get error”
>>> mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql57/mysqld.sock' (2)
>>> while connecting to the MySQL server
>>> Upgrade process encountered error and will not continue.
>>> On the other hand, if I start mysql57-server and then execute
>>> mysql -u root -p
>>> and give the mysql database root password, I can successfully interact with the mysql sever (e.g., “show databases”).
>>> Murray Eisenberg murrayeisenberg at gmail.com <mailto: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 <mailto: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...
More information about the macports-users