Bug #110340 | mysql.session user is being deleted post upgrading to 8.0.28 , normal ? | ||
---|---|---|---|
Submitted: | 10 Mar 2023 15:33 | Modified: | 29 Mar 2023 13:07 |
Reporter: | Eric Vanier | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Security: Privileges | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[10 Mar 2023 15:33]
Eric Vanier
[16 Mar 2023 7:03]
MySQL Verification Team
Hello Eric Vanier, Amit, Thank you for the report and feedback. I tried to reproduce issue by in-place upgrade method i.e from 5.7.41 to 8.0.32(8.0.28) but not seeing anything unusual such as user dropped etc. Could you please share the steps on how exactly your are upgrading(MySQL Binary or Package-based Installations on Unix/Linu such as in-place upgrade or Logical Upgrade etc. - https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html or upgrading using any using rpm/debian repository etc), source/target server instances along with configuration file from source/target instance? Also, it would be good to see unaltered error log post up-gradation. Thank you. If this is happening on Non official builds(Non Oracle builds) then I would suggest you to report to the appropriate place to address. Thank you. regards, Umesh
[16 Mar 2023 7:07]
MySQL Verification Team
## In-place upgrade from 5.7->8.0 - 5.7.41 -build cat ../mysql-5.7.41/docs/INFO_SRC commit: 7d3664116d6e6e11626cf6dfdda54eb08a75568c date: 2022-12-07 23:39:17 +0530 build-date: 2022-12-07 18:11:12 +0000 short: 7d3664116d6 branch: mysql-5.7.41-release MySQL source 5.7.41 rm -rf 110340/ bin/mysqld --no-defaults --initialize-insecure --basedir=$PWD --datadir=$PWD/110340 --log-error-verbosity=3 bin/mysqld_safe --no-defaults --basedir=$PWD --datadir=$PWD/110340 --core-file --socket=/tmp/mysql.sock --port=3306 --log-error=$PWD/110340/log.err --log-error-verbosity=3 --secure-file-priv="" --local-infile=1 2>&1 & mysql> select user from mysql.user; +---------------+ | user | +---------------+ | mysql.session | | mysql.sys | | root | +---------------+ 3 rows in set (0.00 sec) - In place upgrade to 8.0.32 - build cat docs/INFO_SRC commit: 683372e870fea4430bafe8bf06ef6f06a234e539 date: 2022-12-16 13:56:25 +0100 build-date: 2022-12-16 15:36:03 +0000 short: 683372e870f branch: mysql-8.0.32-release MySQL source 8.0.32 bin/mysqld_safe --no-defaults --mysqld-version='' --basedir=$PWD --datadir=/export/home/tmp/ushastry/mysql-5.7.41/110340 --core-file --socket=/tmp/mysql.sock --port=3306 --log-error=/export/home/tmp/ushastry/mysql-5.7.41/110340/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3 --secure-file-priv="" --local-infile=1 2>&1 & bin/mysql -uroot -S /tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.32 MySQL Community Server - GPL Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select user from mysql.user; +------------------+ | user | +------------------+ | mysql.infoschema | | mysql.session | | mysql.sys | | root | +------------------+ 4 rows in set (0.00 sec) mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 4 rows in set (0.00 sec) ### In-place upgrade to 8.0.28 bin/mysql -uroot -S /tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.28 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 4 rows in set (0.00 sec) mysql> shutdown; Query OK, 0 rows affected (0.01 sec)
[27 Mar 2023 20:02]
Eric Vanier
Sorry for the delayed message. We are doing a minor version upgrade from 8.0.20 to 8.0.32 ( RDS MYSQL ) . Using AWS console doing the upgrade , simply modify and apply. Will be able to share some logs tomorrow might be. Thanks Amit
[28 Mar 2023 18:06]
Eric Vanier
Hello Team, Yes mysql.session user is being deleted with the upgrade. It's RDS MySQL. Here are the upgrade logs, but I do not see anything with the user thing though . If possible to do a test case with AWS RDS might help. Should I make a ticket with Amazon. mysqlUpgrade log: 2023-03-28 14:49:14 The mysql_upgrade client is now deprecated. The actions executed by the upgrade client are now done by the server. 2023-03-28 14:49:14 To upgrade, please start the new MySQL binary with the older data directory. Repairing user tables is done automatically. Restart is not required after upgrade. 2023-03-28 14:49:14 The upgrade process automatically starts on running a new MySQL binary with an older data directory. To avoid accidental upgrades, please use the --upgrade=NONE option with the MySQL binary. The option --upgrade=FORCE is also provided to run the server upgrade sequence on demand. 2023-03-28 14:49:14 It may be possible that the server upgrade fails due to a number of reasons. In that case, the upgrade sequence will run again during the next MySQL server start. If the server upgrade fails repeatedly, the server can be started with the --upgrade=MINIMAL option to start the server without executing the upgrade sequence, thus allowing users to manually rectify the problem. ----------------------- END OF LOG ----------------------
[29 Mar 2023 10:12]
MySQL Verification Team
Hi, Thank you for the details. I quickly attempted 8.0.20->8.0.28 in-place upgrade but still not seeing the issue which is reported originally i.e. mysql.session user exists before/after the upgrade(tried --upgrade=FORCE while starting mysqld or deprecated way i.e. by running mysql_upgrade but it just exited with the messages as you have posted here). Looking at the provided log details, I have a question though. Are you still using the mysql_upgrade for the upgrade purpose? Quoting from official manual - As of MySQL 8.0.16, the MySQL server performs the upgrade tasks previously handled by mysql_upgrade (for details, see Section 2.10.3, “What the MySQL Upgrade Process Upgrades”). Consequently, mysql_upgrade is unneeded and is deprecated as of that version; expect it to be removed in a future version of MySQL. Because mysql_upgrade no longer performs upgrade tasks, it exits with status 0 unconditionally. Also, 'mysql.session'@'localhost' it used internally by plugins to access the server. This account is locked so that it cannot be used for client connections. The account is a system account. Is your upgrade process dropping/deleting the user while upgrading? Please let me know. Could you please share the steps on how exactly your are upgrading(MySQL Binary or Package-based Installations on Unix/Linu such as in-place upgrade or Logical Upgrade etc. - https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html or upgrading using any using rpm/debian repository etc) In any case, please use official mysql server package and report us if you encounter this. regards, Umesh
[29 Mar 2023 13:07]
Eric Vanier
Well, As I said it's RDS. So steps are simple ,just few clicks. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Upgrading.ht... 1.Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/. 2.In the navigation pane, choose Databases, and then choose the DB instance that you want to upgrade. 3.Choose Modify. The Modify DB Instance page appears. 4.For DB engine version, choose the new version. 5.Choose Continue and check the summary of modifications. 6.To apply the changes immediately, choose Apply immediately. Choosing this option can cause an outage in some cases. Thanks Amit