I want to programmatically install MySQL to a Mac system running OS 10.11.6 El Capitan, so once the .dmg has been downloaded the script unpack it with the command:

sudo hdiutil attach mysql-5.7.16-osx10.11-x86_64.dmg

after that the script runs:

sudo installer -package /Volumes/mysql-5.7.16-osx10.11-x86_64/mysql-5.7.16-osx10.11-x86_64 .pkg -target /

Here starts the installer, now when I install MySQL from the GUI I get a message-box telling me the temporary password for the root user (see attached picture)

enter image description here

so, what I want is the script to read the temp root password and eventually set a predefined password for the root user:

1) is possilbe to make bash shell read the temp password and store it into a variable?

2) can the script reset the root password automatically?



You must log in to answer this question.

Browse other questions tagged .