using mysql command line with SSH

using mysql command line with SSH

Posted by: msherwoo
Posted on: 2009-01-02 00:26:00

I have connected to my server via SSH to import a mysql table via:

mysql -u UUU -pPPPPPP databasename < file.sql

and I get the error message.

"Can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock"

I have no idea what that means. Any suggestions for how to get this import done?

Thanks,

Mike

Re: using mysql command line with SSH

Posted by: rlparker
Posted on: 2009-01-02 01:15:00

Where is your MySQL hostname in there? You aren't using "localhost", as all DreamHost MySQL servers have a distinctive hostname and you need to include that when you try to connect:

mysql -u yourdblogin -pyourdbpassword -h yourdbdomain.yourdomain.com yourdb

(From the DreamHost wiki article on MySQL)

--rlparker
--DreamHost Tech Support

Tags: mysql tablessh