{"id":94,"date":"2010-07-25T01:09:40","date_gmt":"2010-07-25T01:09:40","guid":{"rendered":"http:\/\/www.itcrumbs.com\/?p=94"},"modified":"2019-02-07T04:40:47","modified_gmt":"2019-02-07T04:40:47","slug":"usefull-plesk-sql-statements","status":"publish","type":"post","link":"https:\/\/www.itcrumbs.com\/?p=94","title":{"rendered":"Usefull Plesk SQL Statements"},"content":{"rendered":"<p><a title=\"http:\/\/www.thesupportsystem.co.uk\/?p=344\" href=\"http:\/\/www.thesupportsystem.co.uk\/?p=344\">http:\/\/www.thesupportsystem.co.uk\/?p=344<\/a><\/p>\n<h6>FTP ACCOUNTS<\/h6>\n<h6>SELECT account_id AS \u2018ID\u2019, login AS \u2018USERNAME\u2019, password AS \u2018PASSWORD\u2019, home AS \u2018HOMEDIR\u2019 FROM sys_users S, accounts A WHERE S.account_id = A.id;<\/h6>\n<h6>MAIL ACCOUNTS<\/h6>\n<h6>For all Domains<\/h6>\n<h6>SELECT account_id AS \u2018ID\u2019, mail_name AS \u2018USERNAME\u2019, password AS \u2018PASSWORD\u2019, postbox as \u2018MAILBOX?\u2019, name AS \u2018DOMAIN\u2019, redir_addr as REDIRECT FROM mail M, domains D, accounts A WHERE M.account_id = A.id AND M.dom_id = D.id ORDER BY name;<\/h6>\n<h6>For a Specific Domain<\/h6>\n<h6>SELECT account_id AS \u2018ID\u2019, mail_name AS \u2018USERNAME\u2019, password AS \u2018PASSWORD\u2019, postbox as \u2018MAILBOX?\u2019, name AS \u2018DOMAIN\u2019, redir_addr as REDIRECT FROM mail M, domains D, accounts A WHERE M.account_id = A.id AND M.dom_id = D.id AND D.name=\u2019<strong><em>****DOMAIN_NAME****<\/em><\/strong>\u2018;<\/h6>\n<h6>MySQL ACCOUNTS<\/h6>\n<h6>Plesk 7<\/h6>\n<h6>SELECT d.name AS DOMAIN, db.name AS DB, du.login as USER, du.passwd as PASS FROM db_users du, data_bases db, domains d WHERE du.db_id = db.id AND db.dom_id=d.id ORDER BY d.name, db.name;<\/h6>\n<h6>Plesk 8 &amp; 9<\/h6>\n<h6>SELECT d.name AS DOMAIN, db.name AS DB, du.login as USER, a.password as PASS FROM db_users du, data_bases db, domains d, accounts a WHERE du.db_id = db.id AND db.dom_id=d.id and du.account_id=a.id ORDER BY d.name, db.name;<\/h6>\n<h6>CLIENT ACCOUNTS<\/h6>\n<h6>Plesk 7<\/h6>\n<h6>SELECT id as \u2018ID\u2019, login as \u2018USERNAME\u2019, passwd as \u2018PASSWORD\u2019, cname as \u2018COMPANY\u2019 FROM clients&#160; ORDER BY login;<\/h6>\n<h6>Plesk 8 &amp; 9<\/h6>\n<h6>SELECT c.id as client, a.id as account, c.login, a.password from clients c, accounts a where a.id=c.account_id;<\/h6>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/www.thesupportsystem.co.uk\/?p=344 FTP ACCOUNTS SELECT account_id AS \u2018ID\u2019, login AS \u2018USERNAME\u2019, password AS \u2018PASSWORD\u2019, home AS \u2018HOMEDIR\u2019 FROM sys_users S, accounts A WHERE S.account_id = A.id; MAIL ACCOUNTS For all Domains SELECT account_id AS \u2018ID\u2019, mail_name AS \u2018USERNAME\u2019, password AS \u2018PASSWORD\u2019, postbox as \u2018MAILBOX?\u2019, name AS \u2018DOMAIN\u2019, redir_addr as REDIRECT FROM mail M, domains D, accounts [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94"}],"version-history":[{"count":1,"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":808,"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions\/808"}],"wp:attachment":[{"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}