You need to select the database connection you'd like to use to run the script.
On the main toolbar, click the menu item highlighted below.
In the dialog box that opens, double click the database connection you'd like to use.
Verified to work with DBeaver Version 25.2.1.202509211659, release date 2025-09-22.