External mysql error in log

I am noticing an error in the log referring to mysql database. I have setup recorder to save data entry to an external database. I log suggest that the connection is lost. Where can I look further to find the cause? HA is able to login to mysql and other files are being updated.


Logger: homeassistant.components.recorder.util
Source: components/recorder/util.py:32
Integration: Recorder (documentation, issues)
First occurred: 6:24:01 AM (1 occurrences)
Last logged: 6:24:01 AM

Error executing query: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: SELECT events.event_type AS events_event_type, events.event_data AS events_event_data, events.time_fired AS events_time_fired, events.context_user_id AS events_context_user_id, states.state_id AS states_state_id, states.state AS states_state, states.entity_id AS states_entity_id, states.domain AS states_domain, states.attributes AS states_attributes, old_state.state_id AS old_state_id FROM events 
LEFT OUTER JOIN states ON events.event_id = states.event_id LEFT OUTER JOIN states AS old_state ON states.old_state_id = old_state.state_id WHERE (events.event_type != %s OR events.event_data != %s OR states.state_id IS NOT NULL AND old_state.state_id IS NOT NULL AND states.state != old_state.state) AND events.event_type IN (%s, %s, %s, %s, %s, %s, %s, %s) AND events.time_fired > %s AND events.time_fired < %s AND (states.last_updated = states.last_changed OR states.state_id IS NULL) ORDER BY events.time_fired] 
[parameters: ('state_changed', '{}', 'state_changed', 'logbook_entry', 'homeassistant_start', 'homeassistant_stop', 'alexa_smart_home', 'script_started', 'automation_triggered', 'homekit_state_change', datetime.datetime(2020, 7, 2, 19, 0, tzinfo=datetime.timezone.utc), datetime.datetime(2020, 7, 2, 22, 0, tzinfo=datetime.timezone.utc))] (Background on this error at: http://sqlalche.me/e/e3q8)


  db_url: !secret MySQL_login
  purge_keep_days: 30
     - group
     - automation
     - camera
     - media_player
     - scene
     - script
     - sun.sun
     - sensor.date_time