chapter-96-mysql/

directory
v1.0.3-0...-4db7b2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2020 License: MIT

README

Using MySQL

  1. Install MySQL -Download MySQL Community Server

  2. We will need a MySQL driver -go get github.com/go-sql-driver/mysql -read the documentation on https://github.com/go-sql-driver/mysql#installation -see all SQL drivers on https://github.com/golang/go/wiki/SQLDrivers -Astaxie's book on https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/05.2.html

  3. Include the driver in your imports -_ "github.com/go-sql-driver/mysql" -Read the documentation -Determine the Data Source Name -user:password@tcp(localhost:5555)/dbname?charset=utf8 -Read the documentation on https://github.com/go-sql-driver/mysql#dsn-data-source-name

  4. Open a connection *db, err := sql.Open("mysql", "user:password@tcp(localhost:5555)/dbname?charset=utf8") package sql golang on https://godoc.org/database/sql

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL