How to save data in 'DataStore (local storage)' to MySQL Table?

You can try this custom formatter: How to : Pass an Array to a Server Action to Write to the Database
Data stores are designed to work on client side and not to be sent to server.