Forums

Upgrade from MySQL 5.5

Hi

I think I may be running into problems because my MYSQL databases are on version 5.5 and I'm running Django 2.2 which requires MySQL 5.6.

> mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| innodb_version          | 5.5.53              |
| protocol_version        | 10                  |
| slave_type_conversions  |                     |
| version                 | 5.5.53-log          |
| version_comment         | Source distribution |
| version_compile_machine | x86_64              |
| version_compile_os      | Linux               |
+-------------------------+---------------------+
7 rows in set (0.01 sec)

I'm getting an error when trying to run

python manage.py migrate

from one of my web apps.

Would it be possible to move to MySQL version 5.6?

Send feedback or an email to support@pythonanywhere.com so we can discuss it.

Hi ! I would like version 5.7 also. I was upgrading to a PWA and we store and send .json from our api all the time.

Send feedback or an email to support@pythonanywhere.com so we can discuss it.

+1 I am facing same issue. Dropped mail to support.

Me too, I could really use MySQL 5.6.5 or higher.

No problem, @Btaub, I have updated your account.

Thanks, @glenn but my console is still showing version 5.5.53 mysql> SHOW VARIABLES LIKE "%version%"; +-------------------------+---------------------+

| Variable_name | Value |

+-------------------------+---------------------+

| innodb_version | 5.5.53 |

| protocol_version | 10 |

| slave_type_conversions | |

| version | 5.5.53-log |

| version_comment | Source distribution |

| version_compile_machine | x86_64 |

| version_compile_os | Linux |

+-------------------------+---------------------+

7 rows in set (0.00 sec)

Do I need do do anything else to upgrade the DB? Thanks!

Sorry about that! Looks like we missed a step. It should be properly migrated now -- could you start a new MySQL console and check?

@giles @glenn Looks good now. Thank you so much for your help! Ben

Excellent, thanks for confirming!

Would it be possible also to upgrade the MySQL server for my account to MySQL 5.6.4 or later?

I am using Django version 2.2.5, which needs MySQL 5.6 or later: https://docs.djangoproject.com/en/2.2/ref/databases/#version-support

However, the current MySQL server on my PythonAnywhere account returns version: 5.5.53

I get an error when I try to add a new datetime field using: python manage.py migrate

ERROR: ...... django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NULL' at line 1")

Django 2.2 uses the datetime format with (fractions of seconds), eg:

created_at datetime(6) NULL

whereas earlier Django versions probably didn't have this "(6)" after datetime:

created_at datetime NULL

MySQL 5.6.4 onward added "Fractional Seconds in Time Values" and Django 2.2 seems to use these in it's migrate commands:

From: https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html

"Fractional Seconds in Time Values ....... MySQL 5.6.4 and up expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) precision: DATETIME(6)"

Thank you.

We could move you to a new MySQL server (v5.7), but it would involve downtime. Email us to schedule a time that would work for us and you to do the move.

Hi, could you please upgrade my mysql version to 5.7+. The MySQL version below 5.7 is not supporting the JSON fields as my project have few json fields in the db structure, Can you do it as soon as possible please. Thank you.

Error Details: (django_mysql.E016) MySQL 5.7+ is required to use JSONField HINT: At least one of your DB connections should be to MySQL 5.7+

Okay, we can migrate you over in 3.5 hours. You should not login and your website will experience downtime then.

@migoindia It's done.

Thank you so much.