Remote restore gz mysql database

1

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?

resting

Posted 2012-05-30T09:34:43.403

Reputation: 611

Answers

0

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.

johnshen64

Posted 2012-05-30T09:34:43.403

Reputation: 4 399