Archive for the ‘mysql’ Category

SELECT DISTINCT CONCAT (‘show grants for `’, user, ‘`@`’, host, ‘`;’) AS query FROM mysql.user;

For this exercise, we will use the mysqldump utility the same as if we were backing up the entire database.


mysqldump -d -h localhost -u root -pmypassword databasename > dumpfile.sql

The only option that is different than creating an entire backup is the -d switch, which tells mysqldump not to output the data.


mysqldump -d -h localhost -u root -p2Uad7as9 database01 > dumpfile.sql


SELECT, mail.mail_name,, accounts.password, mail.postbox, mail.mbox_quota, mail.redirect, mail.redir_addr, mail_group, mail.autoresponder FROM mail, accounts, domains WHERE mail.account_id = AND mail.dom_id = AND = ‘domain.tld’;


init-connect='SET NAMES utf8'


set all to utf8 in my.cnf

1. Log in as root in SSH.
2. Type mysql -uadmin -p`cat /etc/psa/.psa.shadow`, and then press Enter.
3. Type use psa;, and then press Enter.
4. Type select * from sys_users;, and then press Enter.
5. Type select * from accounts where id = 2;, and then press Enter.
A table displays that shows the id, type, and password for accounts where the ID = 2.

SELECT, mail.mail_name, accounts.password, FROM domains LEFT JOIN mail ON = mail.dom_id LEFT JOIN accounts ON mail.account_id =