Error while restoring MYSQL db

mysql

Solution

This often means that your dump file includes a command that should run against a database that either doesn't exist in your local context, or to which the current user does not have access. Open up the dumpfile and look at the line mentioned in the error to find out what's going on.

Problem

Following error occurs when I am trying to restore a DB in MYSQL via putty. Command: `mysql -u root -p db1<dbname.sql ;` ERROR 1 (HY000) at line 7904: Can't create/write to file './dbname/db.opt' (Errcode: 2) What is the reason?

Original source