How to use k6 to connect to mysql database

How to use k6 to connect to mysql database and execute sql

When I use k6 to do functional testing, I need to do this, and check the http response with mysql result

Stock k6 can’t connect to MySQL (or any other DB) yet. We plan to add such features in the future, but for now the only way to do something like this is with an xk6 extension (more info). A basic extension with SQL support already exists here: GitHub - imiric/xk6-sql: k6 Plugin to Load Test SQL Servers (PostgreSQL, MySQL and SQLite3 for now)

Thanks for your reply, I will try it