title: Django handling database table names differently in Ubuntu vs Windows
body: <p>I've built a Django application locally and I'm now trying to deploy it (or at least test) on an AWS EC2 instance using Ubuntu 20.04 (t2.micro).</p>
  <p>When hosted locally, the application works fine. When hosted on AWS, I get a ProgrammingError (1146, &quot;Table 'database_name.exampleAppName_modelname' doesn't exist&quot;).</p>
  <p><strong>What I've tried</strong></p>
  <p>On the server, using MySQL in the command line I've done:</p>
  <pre><code>USE database_name; 
  SHOW tables;
  </code></pre>
  <p>Which lists tables as expected as:</p>
  <pre><code>+----------------------------------------------+
  | Tables_in_database_name                      |
  +----------------------------------------------+
  | auth_group                                   |
  | auth_group_permissions                       |
  | auth_permission                              |
  | auth_user                                    |
  | auth_user_groups                             |
  | auth_user_user_permissions                   |
  | django_admin_log                             |
  | django_content_type                          |
  | django_migrations                            |
  | django_session                               |
  | **exampleappname_modelname**                 |
  </code></pre>
  <p>The cause of the error seems to be fairly obvious in that Django is querying 'exampleAppName' but the database contains 'exampleappname' instead.</p>
  <p>However, when I run the same MySQL commands locally, I get exactly the same list of tables. And when I run the Django app locally there are no errors.</p>
  <p>I checked the names Django is automatically assigning the tables on the server and locally using the shell:</p>
  <pre><code>ModelName._meta.db_table
  </code></pre>
  <p>In both cases, this returns: 'exampleAppName_modelname', which leads to my question.</p>
  <p><strong>What I'd like to know</strong></p>
  <p>If the 'db_table' name auto-assigns the app name in camelcase, why were the table names created in lowercase? Further, if the table names are assigned the same way in both systems, why is it only causing errors for the server?</p>
  <p>I know I can manually change the 'db_table' property by using</p>
  <pre><code>class ModelName(models.Model):
     *fields*
  
     class Meta:
        db_table = 'exampleappname_modelname'
  </code></pre>
  <p>but I would rather understand exactly what is causing this issue so that I don't have to manually override a large number of models.</p>
  <p>In case it matters, I'm using:</p>
  <ul>
  <li>Python 3.8.10</li>
  <li>Django 4.0.1</li>
  <li>MySQL 8.0.27</li>
  <li>mysqlclient 2.1.0</li>
  </ul>