Frequently Asked Questions

Help Center Search

How do I access MySQL using SSH?

Print this Article
Last Updated: November 10, 2008 12:17 PM

The steps for accessing your MySQL database vary depending on whether Plesk is installed on your server.

To Access MySQL Using SSH (Plesk installed)

  1. Log on to your server.
  2. At the command line, type su -. This gives you root access.
  3. At the command line, type mysql -uadmin -p`cat /etc/psa/.psa.shadow`

    NOTE: To reset your MySQL password, at the command line, type mysqladmin -u admin -psetup password $PW

To Access MySQL Using SSH (Plesk not installed)

  1. Log on to your server.
  2. At the command line, type su -. This gives you root access.
  3. At the command line, type mysql -uroot -p
  4. Enter your MySQL root password.

    NOTE: MySQL's default root password is an empty string (no password is set).