title: ERROR 1049 (42000): Unknown database 'mydatabasename'
body: <p>I am trying to restore database from .sql file , i have created the database in phpmyadmin and also using the create if not exist command in the .sql file which i am restoring to the database and both names of database are same in phpmyadmin and .sql file which is"mydatabase".</p>
  
  <p>Here is the command which i am using to restore database.</p>
  
  <pre><code>mysql -uroot -pmypassword mydatabase&lt;mydatabase.sql;
  </code></pre>
  
  <p>When i execute the above command i am getting the following error, i have also given all the permission to the user upon this database.</p>
  
  <pre><code>ERROR 1049 (42000): Unknown database 'mydatabasename'
  </code></pre>
  
  <p>Please help me how can i solve this issue.
  Thanks,</p>