This is a creation in Article, where the information may have evolved or changed.
[Go install]
Originally used sudo apt-get install Golang installation, later found that this is installed GO1 version, so after the compilation Go-sql-driver plugin will have a problem.
Later, as mentioned in reference 2, download the corresponding platform package from Http://www.golangtc.com/download.
Installation is actually very simple, as long as the simple configuration of environment variables, in the. BASHRC Increase
Export goroot= $HOME/bin/go
Export GOARCH=AMD64 #如果是32位就是 =386
Export Goos=linux
Export Path=${path}: $GOROOT/bin
Export Gopath= $HOME/devhome/golang/go_demo
Then execute:
CD $GOROOT/SRC
./all.bash
Just wait for him to finish the load.
[Installation of MySQL]
This is done with Apt-get. As per reference 1, it is simple and convenient:
sudo apt-get install mysql-server mysql-client
New Added Users:
CREATE USER Steven identified by ' XXX ';
Empowerment:
GRANT all privileges on *. * to Steven;
[Go-sql-driver Installation]
With git, go straight to get github.com/go-sql-driver/mysql.
[Vim highlighting for Go syntax]
After configuring the GOROOT environment variable, execute the following script:
Mkdir-p $HOME/.vim/ftdetect
Mkdir-p $HOME/.vim/syntax
Mkdir-p $HOME/.vim/autoload/go
Ln-s $GOROOT/misc/vim/ftdetect/gofiletype.vim $HOME/.vim/ftdetect/
Ln-s $GOROOT/misc/vim/syntax/go.vim $HOME/.vim/syntax
Ln-s $GOROOT/misc/vim/autoload/go/complete.vim $HOME/.vim/autoload/go
echo "Syntax on" >> $HOME/.VIMRC
Resources
- Http://wiki.ubuntu.org.cn/MySQL
- Ubuntu Configuration Go Language development environment (Sublime Text+gosublime)
- Go-sql-driver/mysql
- The "The Go" Chinese version
- "Go Language Programming"