[MDEV-24904] mariadb-upgrade does not consider O/S user as other utilities Created: 2021-02-17  Updated: 2021-03-29

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients, Upgrades
Affects Version/s: 10.5.8
Fix Version/s: 10.5

Type: Bug Priority: Minor
Reporter: Oli Sennhauser Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: mariadb-upgrade, mysql-upgrade, upgrade
Environment:

Linux


Issue Links:
Relates
relates to MDEV-22483 mysql_upgrade does not use current us... Closed

 Description   

The Utility mariadb-upgrade does not consider the O/S user as for example mariadb does. This becomes problematic when running as admin user other than root (for example mysql) because also this user is auth_socket authenticated:

mysql@boss:~ [ma105down, 3306]> id
uid=1001(mysql) gid=1001(mysql) groups=1001(mysql),15(kmem)
 
mysql@boss:~ [ma105down, 3306]> mariadb --help | grep user
user                              (No default value)
 
mysql@boss:~ [ma105down, 3306]> mariadb-upgrade --help | grep user
user                              root
 
mysql@boss:~ [ma105down, 3306]> mysql
mysql@localhost [(none)]> select current_user();
+-----------------+
| current_user()  |
+-----------------+
| mysql@localhost |
+-----------------+
 
mysql@boss:~ [ma105down, 3306]> mariadb-upgrade 
Version check failed. Got the following error when calling the 'mysql' command line client
*ERROR 1698 (28000): Access denied for user 'root'@'localhost'*
FATAL ERROR: Upgrade failed

Unwanted work-around:

mysql@boss:~ [ma105down, 3306]> mariadb-upgrade -umysql
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
...



 Comments   
Comment by Elena Stepanova [ 2021-03-28 ]

There was the bug report MDEV-22483 about this problem; it was suggesting to either change the logic to use the OS user by default, or to change the help text at least.
Given that the latter was chosen, I assume the behavior is "as intended" and root is set as a hard default by design.

Still, assigning to serg for certainty.

Comment by Oli Sennhauser [ 2021-03-29 ]

Not everybody is working with root as O/S user and mysql as DB user. "Segregation of duties" is the buzz word for it.

Generated at Thu Feb 08 09:33:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.