plesk sbin mysqlmng --bind-address local
plesk sbin mysqlmng --bind-address all
plesk sbin mysqlmng --bind-address local
plesk sbin mysqlmng --bind-address all
Retrieve a list of domains and their IP addresses:
plesk db "SELECT d.name, IF(ip.public_ip_address IS NULL, ip.IP_Address, ip.public_ip_address) AS 'IP' FROM domains d JOIN DomainServices ds ON d.id=ds.dom_id JOIN IpAddressesCollections ipc USING(ipCollectionId) JOIN IP_Addresses ip ON ipc.ipAddressId=ip.id WHERE ds.type='web';"
Retrieve unused IP addresses in Plesk via CLI:
plesk bin ipmanage -l | awk '{ if ($4 == 0 && $5 == 0) { print } }'
M_P=$(cat /etc/psa/.psa.shadow); for db in *.sql; do echo "Restoring ${db::-4}"; MYSQL_PWD=$M_P mysql -uadmin < "$db"; done
M_P=$(cat /etc/psa/.psa.shadow); D_C="dump_on_$(date '+%F-%H:%M')"; mkdir "$D_C" && for db in $(MYSQL_PWD=$M_P mysql -uadmin -Nse 'SHOW DATABASES'); do MYSQL_PWD=$M_P mysqldump -uadmin -R --skip-extended-insert "$db" > "$D_C$db.sql"; done
This could be useful for debugging via diff -u (better using vimdiff if installed)
MYSQL_PWD=$(cat /etc/psa/.psa.shadow) mysqldump -uadmin --skip-extended-insert psa > psa_dump_on_"$(date '+%F-%H:%M')".sql
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" systemctl restart mysql systemctl unset-environment MYSQLD_OPTS systemctl restart mysql