MySQL Forums
Forum List  »  Install & Repo

Initial root pasword needed on an unattended FreeBSD12 MySQL80 installation
Posted by: Louis at oracle
Date: December 06, 2021 02:33PM

Hello,

I would like to setup MySQL80 together with other applications on a FreeBSD12-server in a fully automated unattended way (using a zsh script).

After intense googling I am almost sure that that is only possible if the involved MySQL-server already has a root password.

However that is the problem ..... after ^pkg install -y mysql80-server^ the server does not have an root password!

No problem if you are behind the console, however if you would like to to an unattended install ..... you have a problem!
# mysql =u root -p
# Enter PW: <CR>
# > "ALTER USER 'root'@'localhost' IDENTIFIED BY '$MySQLRootPW';FLUSH PRIVILEGES;"
# > quit

After doing that you can send commands to the MySQL server using
mysql -u $user(root) -p$passsword -Bse "command1;command2;....;commandn"

However .... you can only use that command ...... if there is a defined root password ....... which is not present after the install .....

So I need a solution for that, in fact I can image two solution directions:
1) some way to change the "empy root pw" via the shell
2) changing something during or just after the pkg install which force some initial root password to be present

Has someone a solution?

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.