I’ve got the same issue. Did you manage to solve it?
Website A on old server A.
Clone of Website A & Databased onto Cyberpanel Server B.
Adding IP from Server A to “Allow Remote Access on following IP” for the database on Server B.
Changed configs of website A on server A to point to database on Server B.
Issue: Cannot connect to database even though database, user, password & host are correct.