This is a creation in Article, where the information may have evolved or changed.
Before you write it.
Switch from 5.1 to 5.7, mainly by Mysql-server, Mysql-devel, mysql-libs three parts
After successful installation:
-bash-4.1$ mysql -Vmysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper
JSON type Test
Paste_image.png
Perl Client Test CLOB type
The need to install DBI and dbd-mysql, can be made into a green package after the installation can be directly decompressed use.
#CREATE TABLE person (#number INT(11) auto_increment primary key,#name VARCHAR(255),#birthday DATE,#description LONGTEXT);require("MysqlPub.pl");my $dbh = &dbCon("MysqlPub");#插入clob字段和日期字段my $statement = "insert into person(name,birthday,description) values(?,'1983-11-23 00:00:00','跑步跳高')";my $UpdLog = $dbh->prepare($statement);my $result = $UpdLog->execute('liyr');#查看插入信息my $sth = $dbh->prepare("SELECT * FROM person");$sth->execute();while (my $ref = $sth->fetchrow_hashref()) { print "Found a row: number = $ref->{'number'}, name = $ref->{'name'}, birthday = $ref->{'birthday'}, description = $ref->{'description'}\n";}$sth->finish();#doselect测试$statement = "SELECT name FROM person";$sth = &doselect($dbh, $statement);while(my $ref = $sth->fetchrow_arrayref()){ my $name = $ref->[0]; print "doselect test name : $name\n";}$sth->finish();$dbh->disconnect();
Golang Client
Use _ "Github.com/go-sql-driver/mysql" package, the code is also very simple is not posted.