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)
- Log on to your server.
- At the command line, type
su
-. This gives you root access. - 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)
- Log on to your server.
- At the command line, type
su
-. This gives you root access. - At the command line, type
mysql -uroot -p
- Enter your MySQL root password.
NOTE: MySQL's default root password is an empty string (no password is set).