View Full Version : Connecting to mysql via SSH
mairving
04-25-2001, 09:23 AM
Is it possible to connect to mysql in the shell using SSH or do you have to go through the PHPWizard. It doesn't appear that mysql is in your path.
mairving
04-30-2001, 08:00 PM
Anyone have any ideas on this one?
Annette
04-30-2001, 08:39 PM
Sorry, Mark, I missed this one. To access your database via the command line, type
/usr/local/mysql/bin/mysql databasename -u username -ppassword
Note that there are no spaces between the -p and the password.
This will open a mysql connection to your database so that you can do whatever it is you need to do.
To dump the contents of a database:
/usr/local/mysql/bin/mysqldump databasename -u username -ppassword > /home/username/domain-www/somefile.dump
To restore the contents of a database:
/usr/local/mysql/bin/mysql databasename -u username -ppassword < /home/username/domain-www/somefile.dump
All of those commands should be typed on a single line.
mairving
04-30-2001, 08:44 PM
Thanks, Annette. I had forgotten the path.
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.