how can I check database connection to mysql in django

All you need to do is start a application and if its not connected it will fail. Other way you can try is on shell try following -

from django.db import connections
from django.db.utils import OperationalError
db_conn = connections['default']
try:
    c = db_conn.cursor()
except OperationalError:
    connected = False
else:
    connected = True

Run the shell

python manage.py shell

Execute this script

import django
print(django.db.connection.ensure_connection())

If it print None means everything is okay, otherwise it will throw an error if something wrong happens on your db connection