Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I tried

$> ssh root@ip "gunzip < [backupfile.sql.gz] | \
      mysql -u [uname] -p[pass] [dbname]"`

but get the error:

ERROR 1044 (42000) at line 42: Access denied for user '[uname]'@'%'
                               to database '[dbname]'

I could do

$> ssh root@ip "mysql -u [uname] -p[pass] [dbname] -e 'drop table [table]'"

So I guess it can't be a remote permission problem.

What is the correct command to do a remote restore of gz file to mysql via ssh then?

share|improve this question
add comment

1 Answer

The user you are using does not have the file privilege to read file on the server. Just grant file privilege to the user and you will be fine.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.