use strict;
use warnings;

# use DBI;
# my $database = "books.db";
# my $database = ":memory:";
# メモリ上のデータベースへ接続
# my $dbh = DBI->connect("dbi:SQLite:dbname=$database");

use DBI;
my $database = "d1";
my $hostname = "localhost";
my $port = "mysql";
my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
my $user = "kono";
# my $password = "wtrhr3jk";
my $password = "";
my $dbh = DBI->connect($dsn, $user, $password);

# テーブルの作成
my $create_table = "create table counter (" .
                       "author varchar(128)," .
                       "count int" .
                   ");";
$dbh->do($create_table);

# データベースの切断
$dbh->disconnect;


