@@ -129,7 +129,56 @@ Existing deployments upgraded to version 4.20.3 can still continue using MySQL 8
129129without any changes.
130130
131131If you are running MySQL 8.0 and would like to upgrade to MySQL 8.4,
132- you may follow the standard MySQL upgrade process to migrate safely to version 8.4.
132+ you may follow the standard MySQL upgrade process to migrate safely to version 8.4,
133+ and then update the authentication method for the CloudStack and root users with
134+ caching_sha2_password plugin using the below steps as the mysql_native_password plugin
135+ is deprecated as of MySQL 8.0.34, and disabled by default in MySQL 8.4.
136+
137+ * Stop MySQL if already running
138+
139+ .. code-block :: bash
140+
141+ sudo systemctl stop mysqld
142+
143+ * Start in safe mode without auth
144+
145+ .. code-block :: bash
146+
147+ sudo mysqld --skip-grant-tables --skip-networking &
148+
149+ * Login without password
150+
151+ .. code-block :: bash
152+
153+ mysql -u root
154+
155+ * Reset passwords
156+
157+ .. code-block :: bash
158+
159+ ALTER USER ' root' @' localhost' IDENTIFIED WITH caching_sha2_password BY ' ROOT_PASSWORD' ;
160+ ALTER USER ' root' @' %' IDENTIFIED WITH caching_sha2_password BY ' ROOT_PASSWORD' ;
161+ ALTER USER ' cloud' @' localhost' IDENTIFIED WITH caching_sha2_password BY ' CLOUD_PASSWORD' ;
162+ ALTER USER ' cloud' @' %' IDENTIFIED WITH caching_sha2_password BY ' CLOUD_PASSWORD' ;
163+ FLUSH PRIVILEGES;
164+
165+ Note: Please ensure that the password used for the cloud database user matches the value
166+ configured in /etc/cloudstack/management/db.properties. If the password in db.properties
167+ is encrypted, you can retrieve it using:
168+
169+ .. code-block:: bash
170+
171+ java -classpath /usr/share/cloudstack-common/lib/cloudstack-utils.jar \
172+ com.cloud.utils.crypt.EncryptionCLI -d \
173+ -i " $( grep -oP ' db.cloud.password=ENC\(\K[^\)]+(?=\))' /etc/cloudstack/management/db.properties) " \
174+ -p " $( cat /etc/cloudstack/management/key) "
175+
176+ * Restart mysql server
177+
178+ .. code-block :: bash
179+
180+ killall mysqld
181+ systemctl start mysqld
133182
134183 MySQL 8.4 sql mode change
135184-------------------------
0 commit comments