[MDEV-21487] Implement option for mysql_upgrade that allows root@localhost to be replaced Created: 2020-01-09 Updated: 2020-08-25 Resolved: 2020-02-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Scripts & Clients |
| Affects Version/s: | 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Oleksandr Byelkin |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
Some users would like to use a different user than root@localhost as their default superuser. Ideally, users could just do this:
However, in 10.4, there is another complication--root@localhost is the definer of the mysql.user view. This means that the following also needs to be done:
However, there is a problem with this approach. If users had dropped the root@localhost user prior to upgrading to MariaDB 10.4, then the upgrade would be broken, because mysql_upgrade would still create the mysql.user view with the root@localhost definer. For those users, it might be better if mysql_upgrade had an option that could replace root@localhost with another superuser account at upgrade time for the purpose of creating the mysql.user view. e.g.:
|
| Comments |
| Comment by Elena Stepanova [ 2020-01-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It sounds more suitable for mysql_secure_installation than for mysql_upgrade. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2020-01-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi elenst, I can see why you might think that, but I don't think that would solve the problems that our customers are seeing. The current behavior can silently break upgrades when mysql_upgrade is run, and making some change to mysql_secure_installation would not fix that. Consider this scenario: 1.) Customer installs MariaDB 10.3. 2.) Customer creates their own super user account. 3.) Customer drops root@localhost account. 4.) Customer uninstalls MariaDB 10.3. 5.) Customer installs MariaDB 10.4. 6.) Customer runs mysql_upgrade. At this step, mysql_upgrade will seem to succeed:
However, behind the scenes, the mysql.user view is actually broken:
The need for root@localhost user account is tightly integrated into the server in 10.4+ at the moment. If we want to support upgrades from previous versions for users that have dropped this user account, then we need to fix mysql_upgrade, so that it does not break the mysql.user view in this scenario. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2020-02-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
fix will be in |