• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Plesk command line register existing user to domain

jallon

New Pleskian
I have register an existing databases to a new domain on plesk 17.

In plesk database domain i have the message :

  • No database user

It's normal because i have creating the user with sql script.

To register the existing user, i use this command :

  • plesk bin database --register-dbuser dbuser -domain example.com -database sampledb -type mysql -user-role readWrite -passwd dbpass

But i have an error :

  • Database user with such login is already registered.

How can i do ?
 
Hi jallon,

to register an already existing database for a domain, you could use the example command:
Code:
plesk bin database --register sampledb -domain example.com -server localhost:3306

... or if you would like to assign an existing database to a specific subscription, owning the domain "example.com", you could use the example command:
Code:
plesk bin database --assign-to-subscription jdoe-gallery -domain example.com -server localhost:3306



Further Plesk CLI - commands are as well documented at the official Plesk documentation:

 
Yes, thank you but i have already registered my database with the command you write.

What i want is to assign the user of the database (he already as all grant options to the database) in plesk because in plesk i see :
  • No database user
 
Hi jallon,

I already posted the link to the official documentation above. Pls. be so kind to read the additional, possible command options, when you use the Plesk CLI commands:
Code:
plesk bin database ...
 
I am sorry but I have read the documentation several times and I conclude that it is impossible to register an already existing mysql database user on a database of a plesk domain.
 
Hi jallon,

Database user with such login is already registered
and I conclude that it is impossible to register an already existing mysql database user on a database of a plesk domain
To check your current registered databases and the corresponding registered usernames at the psa database, you are able to use the example commands ( logged in as user "root" over SSH ):
Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
followed by
Code:
SELECT domains.name AS domain_name, data_bases.name AS database_name, db_users.login, accounts.password FROM data_bases, db_users, domains, accounts WHERE data_bases.dom_id = domains.id AND db_users.db_id = data_bases.id AND db_users.account_id = accounts.id ORDER BY domain_name;
 
This request is better to check :

Code:
SELECT domains.name AS domain_name, data_bases.name AS database_name, db_users.login, accounts.password 
FROM data_bases
left join db_users on db_users.db_id = data_bases.id
left join domains on domains.id = data_bases.dom_id
left join accounts on accounts.id = db_users.account_id
ORDER BY domain_name;

The line for the domain on which I want to registered the user have a database but null value in login and password
 
Thank you. I have forwarded your report to developers.
 
Back
Top