Useful plesk 8 administration sql commands
If you manage a dedicated web server like we do at sandbox media. You’re probably regularly asked by clients and colleagues to call up forgotten user names and passwords for the their domain and email accounts. We have remote root access to our dedicated server’s Plesk MySQL database which is really handy for such occasions. To do this you will need a client based MySQL tool like CocoaMySQL or MySQL GUI Tools to start brewing your own remote backup scripts (just in-case) and sql commands.
In older versions of plesk the server admin had to create a root user account in the MySQL table to allow access. With Plesk 8 its just a case of adding the correct rule to the firewall. If you have a nice server administrator they should jim’ll fix it for you.
Below are a few scripts which have made my life a lot easier. Please comment if you have new ones to add to the list.
/* returns all ftp accounts for a domain search */ SELECT d.name, s.id, s.login, a.password FROM domains AS d, hosting AS h, sys_users AS s, accounts AS a WHERE d.name LIKE "%thedomain%" AND d.id = h.dom_id AND h.sys_user_id = s.id AND s.account_id = a.id
/* returns all user plesk login accounts for a owner search */ SELECT c.id, d.name, c.cname, c.login, a.password, c.account_id FROM domains AS d, clients AS c, accounts a WHERE c.pname LIKE "%user name%" AND d.cl_id = c.id AND c.account_id = a.id
/* returns all user plesk login accounts for a domain search */ SELECT c.id, d.name, c.cname, c.login, a.password, c.account_id FROM domains AS d, clients AS c, accounts a WHERE d.name LIKE "%thedomain%" AND d.cl_id = c.id AND c.account_id = a.id
/* returns all the mail passwords for a domain name search */ SELECT d.id, d.name, m.mail_name, a.id, a.password FROM domains AS d, mail AS m, accounts a WHERE d.name LIKE "%thedomain%" AND m.dom_id = d.id AND a.id = m.account_id








Thanks, I will find that really useful! I always loose passwords and I use Plesk.