• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue "Select existing Database" not saved for domains

jamin587

New Pleskian
Hello,
url:8443/smb/database/list shows which database belongs to which domain. This setting is not reflectet under url:8443/smb/web/view for all but one domain. Neither changing it under database/list nor with "Select existing Database" from web/view solves this.

Kind regards
Benni
 
Same issue here with Plesk Onyx Version 17.5.3 Update #43 on CentOS 6.9. Perhaps this needs to be filed as a bug report Plesk staff?
 
I'm not getting what you guys are saying... o_O

Is it the "list view" that you want? Try the "wrench" icon and select "Classic List" instead of "Active list"...

With /smb/web/view /smb/database/list I'm getting the databases for the last subscription I've "visited", not all (system wide) databases...

P.S.: but it is 17.8.11 here...
 
I'm not getting what you guys are saying... o_O

Is it the "list view" that you want? Try the "wrench" icon and select "Classic List" instead of "Active list"...

With /smb/web/view /smb/database/list I'm getting the databases for the last subscription I've "visited", not all (system wide) databases...

P.S.: but it is 17.8.11 here...

Hey Sergio. Perhaps it's fixed finally with 17.8? Here's the steps to reproduce so you can tell us if it is!

1. Go to any subscription with multiple domains or subdomains and a database for each one.
2. Go to the Databases tab and use the option to "Assign this database to a site" (if you haven't already) and assign at least a few databases to active domains or subdomains in the subscription. You'll note that after saving the assignment, it always remembers the site assigned to each database.
3. Go to the Websites & Domains tab and look for those domains that you just assigned in the list. Be sure you're in "Active List" mode (not classic)
4. You should now see that your *primary* domain defaults to showing its associated database in a dropdown with an "Open" button beside it. However you should now also see that any domain that is *not* the primary domain is *not* automatically showing that association and instead is asking you to "Select Existing Database" and make the association manually
5. If you then choose to select existing database, then refresh the page, it won't save that selection.

Expected behaviour:

1. After associating the database with a domain under the Databases tab, I expect that the Websites & Domains tab will auto-select that assignment for all domains, not just the primary domain
2. After selecting an existing database from the Websites & Domains tab, I expect it to save that value so when I come back to the page later, it knows which database is associated

---

Does the expected behaviour I just described occur with 17.8?

-Jordan
 
OK, now I think I understand what your issue is, but I have no experience on that as I tend to use one subscription per domain (except for domain aliases...).

Anyway I have a test installation where I'll try to replicate your configuration and I'll let you know how it goes under 17.8.11... just give me some time...
 
I created:
  • a subscription with two domains: a.example.com (primary domain) and b.example.com (secondary domain)
  • 4 databases, each of them with his own database user
What I see (under Plesk 17.8.11) is:
  • only one database can be assigned (related) to a given domain and every domain can have only a database related to it <--- same thing, silly me! :D
  • in "Website & Domains" only the primary domain has the "Databases" entry, where I can open each of the 4 databases and/or create a new database. Secondary domains do not have the "Databases" entry
  • again, clicking on "Databases" I see all 4 databases but there is a bi-univocal (one-to-one) relationship between databases/domains. Assigning a "new" database to a domain removes the old "relation"
  • I have the strong impression that the domain<->database relation is just a kind of "reminder", having nothing to do with access limitation that are instead enforced by the "database user"
Does that match what you see in 17.5.3?
 
Last edited:
BTW, what benefit do you see in having add-on domains under a single subscription instead of separate subscriptions (one for each domain) assigned to a single "customer"?
 
Hey Sergio,

BTW, what benefit do you see in having add-on domains under a single subscription instead of separate subscriptions (one for each domain) assigned to a single "customer"?
  • When you're selling shared hosting, some clients have 5-6 domains of their own, like 1 or two for business and a couple for personal use where they don't find it necessary to pay for a second subscription / hosting plan let alone a reseller plan that allows more than one subscription. It also allows hosting providers to better differentiate between shared and reseller hosting in that shared can only have a singular subscription whereas resellers can have many.
  • It's probably not essential to use addon domains for most with their own VPS nor resellers, but it can have some handy benefits like being able to access all domains within from a single system/ftp user account. On the flip side that obviously also has some security downsides.
  • I also like using the same subscription for things like development and staging environments.

Some replies to your questions/comments:
  • only one database can be assigned (related) to a given domain
Indeed. While obviously you *could* have multiple databases on the same domain, most people just end up with a singular webapp like WordPress per domain and we usually recommend using subdomains for other apps so as to have separate vhost config for each.
  • in "Website & Domains" only the primary domain has the "Databases" entry, where I can open each of the 4 databases and/or create a new database. Secondary domains do not have the "Databases" entry
That's odd. We definitely have a Databases option under each domain within the subscription. Perhaps they removed this capability in 17.8 for add-on domains? That does seem weird to me because clearly any site could have a database and many web hosting users don't understand how the relation works between the domain and its database: such that they should/could be found/accessible under the primary domain but still be accessible to add-on domains.
  • again, clicking on "Databases" I see all 4 databases but there is a bi-univocal (one-to-one) relationship between databases/domains. Assigning a "new" database to a domain removes the old "relation"
Indeed. This is fine. I'm only talking using one database per domain anyway, though clearly you could have more, there usually is one 'main' database that runs a website.
  • I have the strong impression that the domain<->database relation is just a kind of "reminder", having nothing to do with access limitation that are instead enforced by the "database user"
It absolutely is. In fact all databases on any given server are accessible to every domain on the server (not even just within the same subscription) as long as you've got the DB credentials to access it.

But that's the whole point. This functionality of linking domains to databases is something that Plesk provides presumably to make it simpler to keep track of which DB is being used on which domain (assuming you've only got one DB per domain/subdomain) without having to check the web app's configuration file to find it. It's a super handy feature, however you can only see the association when looking at the database list and not when looking at the website list (except for the primary domain, where it works as expected) even though it *appears* like the functionality should work on all domains.

I don't want it to *only* allow me to see the one database when looking at the list of domains but I'd love it if, for each domain, it would default the databases drop down to selecting the associated database, then allow me to select any other to open as well. This is what it does for the primary domain, but it doesn't do it for any addon domains.
 
are you using separate database users for each database/domain or just 1 user for all databases/domains?

It's usually one DB user per database and also often ends up being 1 database per domain/subdomain. I can't say that's *always* the case, but it's a default scenario that probably happens about 90% of the time.
 
  • in "Website & Domains" only the primary domain has the "Databases" entry, where I can open each of the 4 databases and/or create a new database. Secondary domains do not have the "Databases" entry
That's odd. We definitely have a Databases option under each domain within the subscription. Perhaps they removed this capability in 17.8 for add-on domains? That does seem weird to me because clearly any site could have a database and many web hosting users don't understand how the relation works between the domain and its database: such that they should/could be found/accessible under the primary domain but still be accessible to add-on domains.

Yes, it really seems that Plesk changed that in 17.8.11, but there is another thing I just noticed: that "Databases" entry under the main domain doesn't show up until you create an add-on domain under the same subscription: until then you have "Databases" as the top tab only. See pictures here below:

1 Domain, 1 Database
1domain-1db-new.png


2 Domains, 1 Database
2domains-1db-new.png


IMHO, keeping different (non-alias) domains in different subscriptions has some benefit that absolutely goes along your rationale:

  • It is very clear which DB belongs to which domain
  • Domains have their files in the same directory (relative to the subscription root), i.e. /httpdocs, which is not the case for add-on domains
  • File manager is kept "private" for each domain
  • Most important, you can remove each domain independently of the others (deleting a main domain also deletes add-on domains)
That's why I think the "one customer, many subscriptions" solution is more flexible, but of course you may have a different opinion, depending on your usage scenario...

What I'm missing now is: do we have an issue here or all that is happening should be considered "expected behavior"?

Cheers!

Sergio
 
Last edited:
That's why I think the "one customer, many subscriptions" solution is more flexible, but of course you may have a different opinion, depending on your usage scenario...

I don't disagree, but when you're using Plesk as part of a commercial hosting platform and competing against hosting providers with cPanel, you have no choice but to offer addon domains, and this is the only way to make that happen. It's just a completely different use-case from operating your own VPS where you're the admin and can do whatever you want.

What I'm missing now is: do we have an issue here or all that is happening should be considered "expected behavior"?

I think it's technically an issue with Plesk 17.5, however it certainly appears that by not showing a Databases button on add-on domains in 17.8 there'd be no reason to fix this as the functionality where things appear broken in 17.5 won't exist upon upgrade. We'll be doing some 17.8 upgrades in the next couple months so I'll be sure to report back here if I find anything different about this functionality (ex: if different licensing or environment variables might be affecting this functionality. I doubt it, but you never know!)
 
... and BTW, I used cPanel in the past, and, exactly, there is something definitely cPanel-ish in the "add-on domains inside a subscription" organization! ;)
 
Back
Top