????1??MySQL????
????Go?????MySQL????????????????????????Щ?????database/sql?????????Щ??????????????????????????????????:
????https://github.com/Go-SQL-Driver/MySQL ???database/sql?????????goд??
????https://github.com/ziutek/mymysql ???database/sql??????????????????????goд??
????https://github.com/Philio/GoMySQL ?????database/sql?????????????????goд??
????2?????????
???????????????С???????????????????????????????????test???????userinfo??????????????userdetail??
CREATE TABLE `userinfo` (
`uid` INT(10) NOT NULL AUTO_INCREMENT??
`username` VARCHAR(64) NULL DEFAULT NULL??
`departname` VARCHAR(64) NULL DEFAULT NULL??
`created` DATE NULL DEFAULT NULL??
PRIMARY KEY (`uid`)
)
CREATE TABLE `userdetail` (
`uid` INT(10) NOT NULL DEFAULT '0'??
`intro` TEXT NULL??
`profile` TEXT NULL??
PRIMARY KEY (`uid`)
)