Archive

Archive for the ‘Plesk’ Category

Frequently Used Mysql Commands for Plesk Control Panel

April 30th, 2012 Comments off

Though there are more number of users of cPanel due to higher number of webmasters demanding for cPanel shared hosting but still, Plesk is one of the best things for managing your windows web hosting accounts. In case you don’t have a password and want to backup or restore the database then you can go for the following commands

mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` dbname > backupfile.sql

This command is used for taking MySQLdump backup of the database as a ‘admin’ user

mysql -uadmin -p`cat /etc/psa/.psa.shadow` dbname < backupfile.sql

This command is used for restoring MySQLdump backup to an empty database as a ‘admin’ user

cat /etc/psa/.psa.shadow

But still having the password with you is important so after running this command one can get the password for admin user in return. But one needs to run it in specific manner as given below.

mysqldump -uusername -ppassword dbname > backupfile.sql

mysql -uusername -ppassword  dbname < backupfile.sql

When you are aware of password you can run the above commands for backup and restoration of you database.

(Note:- replace ‘username’ with your username, ‘password’ with your password and ‘dbname’ with your database name)

mysqlcheck -uadmin -p`cat /etc/psa/.psa.shadow` -r databasename

By running the above command you can perform MySQL check for any possible repairs.

mysqlcheck -uadmin -p`cat /etc/psa/.psa.shadow` -o databasename

The above command is for performing MySQL check for any possible optimization over it.