dklann / mycnf

Golang module to read a .my.cnf file and extract credentials and other details to connect to a MySQL database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mycnf

Read a .my.cnf file and extract credentials and other details to connect to a MySQL database.

func ReadMyCnf reads a .my.cnf (~/.my.cnf by default), searches for the named "profile" in that file and returns a DSN (string) suitable for use in sql.Open().

This is based on a gist from https://gist.github.com/nickcarenza and modified to accept default values passed in a structure from the calling function.

Read the complete documentation at GoDoc.

About

Golang module to read a .my.cnf file and extract credentials and other details to connect to a MySQL database.

License:GNU General Public License v3.0


Languages

Language:Go 100.0%