[MDEV-25326] mysql_install_db help text incomplete Created: 2021-04-01 Updated: 2021-07-15 Resolved: 2021-04-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.2.38, 10.3.31, 10.4.21, 10.5.12, 10.6.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
| Comments |
| Comment by Elena Stepanova [ 2021-04-01 ] | |||||||||||||||||||||||
|
It doesn't really affect 10.4+, only 10.2 and 10.3, as 10.4+ creates different accounts and prints an entirely different message.
| |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-04-01 ] | |||||||||||||||||||||||
|
10.4+ versions are also affected, they print this text if unix_socket authentication was disabled. | |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2021-04-01 ] | |||||||||||||||||||||||
|
In this case I suggest to keep only the part about mysql_secure_installation, as a clear official recommendation. | |||||||||||||||||||||||
| Comment by Daniel Black [ 2021-04-02 ] | |||||||||||||||||||||||
|
As part of MDEV-23494 I was planning on adding a mysql_install_db --auth-root-password-env and --auth-root-hostname option. I've got a shell/sql escaping mechanism ready - https://github.com/MariaDB/mariadb-docker/pull/356 . I'd rather never see an option 2 regardless of release version, because users will try it later anyway, put it in blogs, SO answers and cause everyone to suffer. Like https://mariadb.com/kb/en/root-password-change-how-can-i-stop-the-mysqld-in-the-mariadb-container/ it seems the use of mysql_secure_installation is still quite popular. There does seem to be an excessive amount of copy/paste of it (https://github.com/vitessio/vitess/pull/7318, https://github.com/MariaDB/mariadb-docker/blob/master/docker-entrypoint.sh#L277), so I'd like to see some cleanup of it eventually so it has more portability than it really needs (https://github.com/vitessio/vitess/pull/7460). My preference is option 3 so people actually know about `set password`. Lets remove mysql references as if people search there for mysql_install_db they'll see 8.0 removed documentation which won't help. When can we drop the root@<hostname>? Its really ugly and depends on proper reverse DNS resolution. | |||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2021-04-02 ] | |||||||||||||||||||||||
|
I too like option 3, though would reverse it, i.e. mention mysql_secure_installation first, and then the commands to directly set the passwords as the alternative. This gives beginner users an easy method, and leaves the handy commands there for pro users to copy/paste. Also, changing 'Alternatively you can run:' to 'Alternatively you can run (after starting the server):' makes the text somewhat more clear imho, even if it is mentioned earlier already. | |||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2021-04-02 ] | |||||||||||||||||||||||
|
Probably option 3 is the best (with Roel's reverse idea considered, it may be counter productive if the text scrolls up on the terminal). As a side note, what if we create some stored procedure like mysql.set_root_password('new_password') with the new root password as an argument, and update instructions to call it? Then no matter how many local root accounts are present and what method of update we use, it will be a single stored procedure call for the user. | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-04-02 ] | |||||||||||||||||||||||
|
Option 3 one runs mysql four times as passwordless root, so SET PASSWORD FOR root@localhost must be the last. Unless one has protocol=tcp in the ~/.my.cnf in which case some other SET PASSWORD line must be the last. One way out of it would be to run mysql only once, like
or even
perhaps modified as
but really, I'd rather prefer a simple solution and just go with option four. | |||||||||||||||||||||||
| Comment by Daniel Black [ 2021-04-06 ] | |||||||||||||||||||||||
|
I'm ok with option four. I like the last option above too. I'd rather not end up with another less maintained script like option 5. I think the main users are going to be packagers/sysadmins rather than first time users, but if we can account for both, more the merrier. | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-07-15 ] | |||||||||||||||||||||||
|
Bad merge, the fix didn't get into 10.3+. Re-fixing. |