title: Updating a database in a server using command-line
body: <p>I have been searching for a while to find a good answer to my problem. 
  I have a new server where I would like to run a script in <code>.php</code> which uses a database to store some data. What I have done so far is:</p>
  
  <ol>
  <li>Place the .php file in the server with the help of Putty. </li>
  <li>Create a database in phpmyadmin, export it and place it in the same folder of my project in putty. </li>
  <li>Run <code>php5 crawl.php &gt; logfile.log 2&amp;&gt;1&amp;</code></li>
  </ol>
  
  <p>but it doesn't update the database. </p>
  
  <p>I am little bit confused with the steps I have to make in order to make it work. I have been reading also this article <a href="http://www.aspkin.com/using-putty-to-import-a-database/" rel="nofollow">http://www.aspkin.com/using-putty-to-import-a-database/</a> but when I run the </p>
  
  <pre><code>mysql -u dbusername -p databasename &lt; backupname.sql
  </code></pre>
  
  <p>I get this error:  </p>
  
  <blockquote>
    <p>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</p>
  </blockquote>
  
  <p>Any idea what I might be doing wrong?</p>