Golang Connecting Mysql Database

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Search below to find a Golang library address:

Http://go-lang.cat-v.org/library-bindings

There are databases: GUI and so on.

Discover the latest on this update time: Download the zip package.

Https://github.com/Philio/GoMySQL

Compiled discovery can only be compiled under Linux. Windows didn't fix it.

First set the environment variables under Linux:

Export path= $PATH:/opt/google/go/binexport goroot=/opt/google/go

Then unzip

Clone the Git repository:

git clone git://github.com/Philio/GoMySQL.git

Build/install:

cd GoMySQL
make
make install

This installs the "MySQL" so can is imported as so:

import "mysql"


If the compilation does not report an error. The instructions have been compiled and passed. You can use the MySQL package.

Using a MySQL database connection is also under study.

Go language video.

Chinese:

Http://v.youku.com/v_show/id_XMTY4Mzk5NTc2.html

English:

Http://v.youku.com/v_show/id_XMTMxMzIwMTQ4.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.