How to connect to a MySQL database?


I’ve recently decided to move my Discord.js bot back to Glitch after finding that packages like libsodium, etc wouldn’t install on my self-hosted machine. One of the big issues with Glitch is the storage. Let’s face it, you only get 194MB of on-disk storage, not enough to hold the data I will require in the future. So, I have set up my own MySQL database, I looked through Thus, I found no project template thingy on how to connect to a MySQL DB.

In other words,

How do I connect to a MySQL database via Glitch.

I have my DB name, username, password & hostname.

Any help would be appreciated!

- Charlie

The MySQL node.js package is pretty well documented, see


Thank you! I had searched his up before but when I saw the word driver I thought it was better to check that it was fine.

How to make changes to mysql without su password? any ideas?