Skip to main content

How to execute MySql admin level cmd lines without knowing the MySql admin password.

 

Use -uadmin -p`cat /etc/psa/.psa.shadow` to specify the “root” mysql password in the cmd line.

admin is the “root” MySQL user in Plesk for Linux.

`cat /etc/psa/.psa.shadow` retrieves the admin password and use it in the cmd.

Examples

mysqlcheck -uadmin -p`cat /etc/psa/.psa.shadow` –optimize –all-databases

To view the MySQL version

mysql -V -uadmin -p`cat /etc/psa/.psa.shadow`

 

Import database dump /var/www/vhosts/new.amphibic.co.za/newamp.sql into database newamp_wp

MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin newamp_wp < /var/www/vhosts/new.amphibic.co.za/newamp.sql

 

Amphibic Design

Author Amphibic Design

More posts by Amphibic Design

Leave a Reply

amphibic.design