• 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.

Forwarded to devs Plesk command line : register existing user to database domain

jallon

New Pleskian
TITLE:
Plesk command line : register existing user to database domain
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
Product version: Plesk Onyx 17.5.3 Update #20
Update date: 2017/08/29 03:09
Build date: 2017/03/17 16:00
OS version: CentOS 7
Revision: 55d1b49a272f44666e1920eca8b6e4da449a38cd
Architecture: 64-bit
Wrapper version: 1.2
PROBLEM DESCRIPTION:
I have created a mysql database and a mysql user with mysql cli
i have granted all privileges for the user to the database
I have registered the database to a plesk domain with plesk command line

Impossible to register the user in the plesk database​
STEPS TO REPRODUCE:
  • plesk interface
Create the domain mydomain in plesk
  • Mysql cli
Code:
CREATE DATABASE `mydb`;
Code:
CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'mypass';
Code:
GRANT ALL PRIVILEGES ON `mydb`.* TO 'dbuser'@'localhost' WITH GRANT OPTION;
  • plesk command line
Code:
plesk bin database --register mydb -domain mydomain -server localhost:3306
Code:
plesk bin database --register-dbuser dbuser -domain mydomain -type mysql -database mydb -passwd mypass
Result :
Database user with such login is already registered.
exit status 2
ACTUAL RESULT:
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
WHERE domains.name = 'mydomain';

Result :

+------------------+----------------+-------+----------+
| domain_name | database_name | login | password |
+------------------+----------------+-------+----------+
| mydomain | mydb | NULL | NULL |
+------------------+----------------+-------+----------+​
EXPECTED RESULT:
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
WHERE domains.name = 'mydomain';

Result :

+------------------+----------------+-------+----------+
| domain_name | database_name | login | password |
+------------------+----------------+-------+----------+
|mydomain | mydb | dbuser | xxxxxx |
+------------------+----------------+-------+----------+​
ANY ADDITIONAL INFORMATION:
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Help with sorting out
 
Last edited:
From developers:

Cannot reproduce on 17.5.3 MU#22:

MariaDB [psa]> create database mydb;
Query OK, 1 row affected (0.02 sec)

MariaDB [psa]> create user myuser identified by 'mypass';
Query OK, 0 rows affected (0.05 sec)

MariaDB [psa]> grant all on mydb.* to myuser with grant option;
Query OK, 0 rows affected (0.00 sec)


# plesk bin database --register mydb -domain mydomain.tld -server localhost:3306
The database was successfully registered.

# plesk bin database --register-dbuser myuser -domain mydomain.tld -type mysql -database mydb -passwd mypass
The database user was successfully registered.
 
Cannot reproduce to if i manually create the domain in plesk interface but i reproduce with imported domain for another plesk server (version 12.5).
In the 12.5 server the database and user wasn't registered in plesk.
 
Back
Top