Connecting my Go code to MySQL

Опубликовано: 05 Апрель 2026
на канале: HunCoding
3,179
161

Hey everyone, how's it going?

With videos about APIs and Go itself, now comes a cool part about how to start saving the data generated by your Go application in an SQL database, in this case, MySQL. We'll look at several databases later, but I started with MySQL because it's an easy and widely used database.

Chapters:
00:00 Introduction
01:30 Starting MySQL with Docker
04:30 Running initial commands
06:35 MySQL driver for GoLang
10:55 Inserting data into the database
16:00 Retrieving data from the database

Important links:

GoLang MySQL driver
https://github.com/go-sql-driver/mysql
Docker MySQL
https://hub.docker.com/_/mysql
Docker installation
https://docs.docker.com/engine/instal...
MySQL Workbench installation
https://dev.mysql.com/downloads/workb...

All the code is saved on the channel's GitHub, so if you want to replicate it on your PC, just access it to get the code!

https://github.com/HunCoding

If you have any questions, feel free to leave them in the comments and we can discuss them and try to answer them!

Thanks!