diff --git a/ansible/roles/mariadb/tasks/precheck.yml b/ansible/roles/mariadb/tasks/precheck.yml
index 7706fa716b..f852456477 100644
--- a/ansible/roles/mariadb/tasks/precheck.yml
+++ b/ansible/roles/mariadb/tasks/precheck.yml
@@ -17,7 +17,7 @@
 - name: Checking free port for MariaDB
   wait_for:
     host: "{{ api_interface_address }}"
-    port: "{{ database_port }}"
+    port: "{{ mariadb_port }}"
     connect_timeout: 1
     timeout: 1
     state: stopped
diff --git a/ansible/roles/mariadb/tasks/restart_services.yml b/ansible/roles/mariadb/tasks/restart_services.yml
index b80c909f3e..dcc178ef33 100644
--- a/ansible/roles/mariadb/tasks/restart_services.yml
+++ b/ansible/roles/mariadb/tasks/restart_services.yml
@@ -31,7 +31,7 @@
   become: true
   command: >-
     {{ kolla_container_engine }} exec {{ mariadb_service.container_name }}
-    mysql -uroot -p{{ database_password }}
+    mysql -uroot -p{{ database_password }} -P {{ mariadb_port }}
     --silent --skip-column-names
     -e 'SHOW STATUS LIKE "wsrep_local_state_comment"'
   changed_when: false
diff --git a/releasenotes/notes/bug-2024554-6eb811364536f1e8.yaml b/releasenotes/notes/bug-2024554-6eb811364536f1e8.yaml
new file mode 100644
index 0000000000..1db1d5a16f
--- /dev/null
+++ b/releasenotes/notes/bug-2024554-6eb811364536f1e8.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Fixes 2024554.
+    Adds mariadb_port to the wsrep sync status check.
+    This is so none standard ports can be used for mariadb deployments.
+    `LP#2024554 <https://launchpad.net/bugs/2024554>`__