MySQL upgrade 5.7.19 version JSON type Test and Perl with Go-client

Source: Internet
Author: User
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.

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.