```go
package main

import (
	"database/sql"
	"encoding/json"
	"fmt"
	"log"
	"net/http"

	"github.com/gorilla/mux"
	_ "github.com/go-sql-driver/mysql"
)

// Connect to the MariaDB database
func dbConn() (db *sql.DB) {
	dbDriver := "mysql"
	dbUser := "your_db_user"
	dbPass := "your_db_password"
	dbName := "your_db_name"
	dbHost := "localhost"
	dbPort := "3306"

	connStr := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s", dbUser, dbPass, dbHost, dbPort, dbName)

	db, err := sql.Open(dbDriver, connStr)
	if err != nil {
		panic(err.Error())
	}
	return db
}

// Note struct
type Note struct {
	ID      int    `json:"id"`
	Title   string `json:"title"`
	Content string `json:"content"`
}

// CreateNote creates a new note in the database.
func CreateNote(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	var note Note
	err := json.NewDecoder(r.Body).Decode(&note)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	insertQuery := "INSERT INTO notes(title, content) VALUES(?, ?)"
	stmt, err := db.Prepare(insertQuery)
	if err != nil {
		panic(err.Error())
	}
	defer stmt.Close()

	result, err := stmt.Exec(note.Title, note.Content)
	if err != nil {
		panic(err.Error())
	}

	id, err := result.LastInsertId()
	if err != nil {
		panic(err.Error())
	}

	note.ID = int(id)
	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(note)
}

// GetNotes retrieves all notes from the database.
func GetNotes(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	selectQuery := "SELECT id, title, content FROM notes"
	rows, err := db.Query(selectQuery)
	if err != nil {
		panic(err.Error())
	}
	defer rows.Close()

	var notes []Note
	for rows.Next() {
		var note Note
		err := rows.Scan(&note.ID, &note.Title, &note.Content)
		if err != nil {
			panic(err.Error())
		}
		notes = append(notes, note)
	}

	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(notes)
}

// UpdateNote updates an existing note in the database.
func UpdateNote(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	vars := mux.Vars(r)
	id := vars["id"]

	var note Note
	err := json.NewDecoder(r.Body).Decode(&note)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	updateQuery := "UPDATE notes SET title=?, content=? WHERE id=?"
	stmt, err := db.Prepare(updateQuery)
	if err != nil {
		panic(err.Error())
	}
	defer stmt.Close()

	_, err = stmt.Exec(note.Title, note.Content, id)
	if err != nil {
		panic(err.Error())
	}

	w.WriteHeader(http.StatusNoContent)
}

// DeleteNote deletes a note from the database.
func DeleteNote(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	vars := mux.Vars(r)
	id := vars["id"]

	deleteQuery := "DELETE FROM notes WHERE id=?"
	stmt, err := db.Prepare(deleteQuery)
	if err != nil {
		panic(err.Error())
	}
	defer stmt.Close()

	_, err = stmt.Exec(id)
	if err != nil {
		panic(err.Error())
	}

	w.WriteHeader(http.StatusNoContent)
}

func main() {
	router := mux.NewRouter()

	router.HandleFunc("/notes", CreateNote).Methods("POST")
	router.HandleFunc("/notes", GetNotes).Methods("GET")
	router.HandleFunc("/notes/{id}", UpdateNote).Methods("PUT")
	router.HandleFunc("/notes/{id}", DeleteNote).Methods("DELETE")

	log.Fatal(http.ListenAndServe(":8080", router))
}
```
```go
package main

import (
	"database/sql"
	"encoding/json"
	"fmt"
	"log"
	"net/http"

	"github.com/gorilla/mux"
	_ "github.com/go-sql-driver/mysql"
)

// Connect to the MariaDB database
func dbConn() (db *sql.DB) {
	dbDriver := "mysql"
	dbUser := "your_db_user"
	dbPass := "your_db_password"
	dbName := "your_db_name"
	dbHost := "localhost"
	dbPort := "3306"

	connStr := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s", dbUser, dbPass, dbHost, dbPort, dbName)

	db, err := sql.Open(dbDriver, connStr)
	if err != nil {
		panic(err.Error())
	}
	return db
}

// Note struct
type Note struct {
	ID      int    `json:"id"`
	Title   string `json:"title"`
	Content string `json:"content"`
}

// CreateNote creates a new note in the database.
func CreateNote(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	var note Note
	err := json.NewDecoder(r.Body).Decode(&note)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	insertQuery := "INSERT INTO notes(title, content) VALUES(?, ?)"
	stmt, err := db.Prepare(insertQuery)
	if err != nil {
		panic(err.Error())
	}
	defer stmt.Close()

	result, err := stmt.Exec(note.Title, note.Content)
	if err != nil {
		panic(err.Error())
	}

	id, err := result.LastInsertId()
	if err != nil {
		panic(err.Error())
	}

	note.ID = int(id)
	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(note)
}

// GetNotes retrieves all notes from the database.
func GetNotes(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	selectQuery := "SELECT id, title, content FROM notes"
	rows, err := db.Query(selectQuery)
	if err != nil {
		panic(err.Error())
	}
	defer rows.Close()

	var notes []Note
	for rows.Next() {
		var note Note
		err := rows.Scan(&note.ID, &note.Title, &note.Content)
		if err != nil {
			panic(err.Error())
		}
		notes = append(notes, note)
	}

	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(notes)
}

// UpdateNote updates an existing note in the database.
func UpdateNote(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	vars := mux.Vars(r)
	id := vars["id"]

	var note Note
	err := json.NewDecoder(r.Body).Decode(&note)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	updateQuery := "UPDATE notes SET title=?, content=? WHERE id=?"
	stmt, err := db.Prepare(updateQuery)
	if err != nil {
		panic(err.Error())
	}
	defer stmt.Close()

	_, err = stmt.Exec(note.Title, note.Content, id)
	if err != nil {
		panic(err.Error())
	}

	w.WriteHeader(http.StatusNoContent)
}

// DeleteNote deletes a note from the database.
func DeleteNote(w http.ResponseWriter, r *http.Request) {
	db := dbConn()
	defer db.Close()

	vars := mux.Vars(r)
	id := vars["id"]

	deleteQuery := "DELETE FROM notes WHERE id=?"
	stmt, err := db.Prepare(deleteQuery)
	if err != nil {
		panic(err.Error())
	}
	defer stmt.Close()

	_, err = stmt.Exec(id)
	if err != nil {
		panic(err.Error())
	}

	w.WriteHeader(http.StatusNoContent)
}

func main() {
	router := mux.NewRouter()

	router.HandleFunc("/notes", CreateNote).Methods("POST")
	router.HandleFunc("/notes", GetNotes).Methods("GET")
	router.HandleFunc("/notes/{id}", UpdateNote).Methods("PUT")
	router.HandleFunc("/notes/{id}", DeleteNote).Methods("DELETE")

	log.Fatal(http.ListenAndServe(":8080", router))
}
```