Welcome to the Netlify Forums. For database questions, I recommend starting with this Support Guide:
After reading that, check out this recent article from the Netlify Blog outlining how to build a database-driven Jamstack site. In it there are steps for creating a mySQL database, connecting plugins, etc.