title: Django book Chapter 5 Database Engine setting
body: <p>I'm pretty sure I followed the procedures for this tutorial accurately but I'm still getting errors =/</p>
  
  <p>Currently, my settings.py DATABASES looks like this</p>
  
  <pre class="lang-py prettyprint-override"><code>DATABASES = {
      'default': {
          'ENGINE': 'mysql',  # Add 'postgresql_psycopg2', 'mysql','sqlite3' or 'oracle'.      
          'NAME': 'mydb',     # Or path to database file if using sqlite3.
          'USER': 'user',     # Not used with sqlite3.
          'PASSWORD': 'pwd',  # Not used with sqlite3.
          'HOST': '',         # Set to empty string for localhost. Not used with sqlite3.
          'PORT': '',         # Set to empty string for default. Not used with sqlite3.
      }
  }
  </code></pre>
  
  <p>The tutorial tells me to have 'mysql' in ENGINE. However when I try to use the command 'python manage.py shell' I get this error</p>
  
  <pre class="lang-none prettyprint-override"><code>django.core.exceptions.ImproperlyConfigured: 'mysql' isn't an available database backend.
  Try using django.db.backends.mysql instead.
  Error was: No module named mysql.base
  </code></pre>
  
  <p>This is why I have <code>django.db.backends.mysql</code> next to <code>ENGINE</code>.</p>
  
  <p>After these settings, the tutorial tells me to type in these commands</p>
  
  <pre><code>'python manage.py shell'     &lt;--- works fine
  
  from django.db import connection      &lt;--- works fine
  
  cursor = connection.cursor()          &lt;--- uh oh
  </code></pre>
  
  <p>After running the cursor command, I get this error</p>
  
  <p><a href="http://pastebin.com/8MtYq7rg" rel="nofollow">http://pastebin.com/8MtYq7rg</a></p>
  
  <p>Not really sure what this means =/</p>
  
  <p>When I try to run my server with <code>python manage.py runserver</code> I get this error. Not sure what this means either but the last error seems to be the same.</p>
  
  <p><a href="http://pastebin.com/91U3dz73" rel="nofollow">http://pastebin.com/91U3dz73</a></p>
  
  <p>Also I looked up online to use <code>python manage.py dbshell</code> to test my DB access and this is the message I get.</p>
  
  <p><code>Error: You appear not to have the 'mysql' program installed or on your path.</code></p>
  
  <p>I posted this problem on reddit to see if I could get any extra help. I hope some of this information provides extra help to this problem. </p>
  
  <ol>
  <li>Type MySQL in a shell and see the result</li>
  <li>Post how you installed MySQL. Did you make a table for Django to use already?</li>
  <li><p>What OS are you using?</p>
  
  <ol>
  <li><p>Nothing happens when I type in MySQL in shell. When I type in the command 'python manage.py shell' then MySQL. I get an error "NameError: name 'MySQL' is not defined". When i type MySQL in terminal, it says MySQL: command not found</p></li>
  <li><p>How I installed MySQL was that I downloaded the file and then extracted where the tar file is located. Next I put the extracted folder into /home/Development directory. All my code is stored in /home/Development/djcode/mysite/mysite/</p></li>
  <li><p>I am using Ubuntu</p></li>
  </ol></li>
  </ol>
  
  <p><em><strong></em>**<em>*</em>***</strong><em>UPDATE</em><strong><em>*</em></strong><em>UPDATE</em><strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**</strong></p>
  
  <p>So I believe that I was getting my error due to the fact that I didn't have MySQL installed/downloaded. What I had was MySQL-Python which isnt the same thing... But anyways, I downloaded/installed MySQL and ran python shell with 'python manage.py shell' then 'from django.db import connection' and then 'cursor = connection.cursor()'</p>
  
  <p>However, I get the following error</p>
  
  <p>OperationalError: (1045, "Access denied for user 'bradford'@'localhost' (using password: YES)")</p>
  
  <p>Not sure what to do at this point =/</p>