The same MS SQL server instance is added to Plesk twice

Created:

2017-06-17 23:25:40 UTC

Modified:

2017-08-16 17:38:12 UTC

0

Was this article helpful?


Have more questions?

Submit a request

The same MS SQL server instance is added to Plesk twice

Applicable to:

  • Plesk for Windows

Question

The same MS SQL server instance is added to Plesk twice at Plesk > Tools & Settings > Database Servers : by IP address and by a domain name.

How to merge these databases in one instance?

Answer

1. Create a psa database dump:

# plesk db dump psa > psa_dump.sql

2. Retrieve exampleDB id from psa.databaseservers table:

mysql> select id, host from databaseservers where host="exampleDB";
+----+
| id |
+----+
| 3 |
+----+
1 row in set (0.00 sec)

3. Retrieve 127.0.0.1 id from psa.databaseservers table:

mysql> select id, host from databaseservers where host="127.0.0.1";
+----+
| id |
+----+
| 2 |
+----+
1 row in set (0.00 sec)

4. Update the database server ID for all databases and users that belong to 127.0.0.1 database server in Plesk:

mysql> update db_users set db_server_id=3 where db_server_id=2;
Query OK, 74 rows affected (0.01 sec)
Rows matched: 74 Changed: 74 Warnings: 0

mysql> update data_bases set db_server_id=3 where db_server_id=2;
Query OK, 67 rows affected (0.01 sec)
Rows matched: 67 Changed: 67 Warnings: 0

5. Remove 127.0.0.1 server from Plesk > Tools & Settings > Database Servers .

6. Verify that databases which were registered in Plesk on 127.0.0.1 belong to exampleDB and can be managed from Plesk.

Have more questions? Submit a request
Please sign in to leave a comment.