使用Perl语言连接数据:
my $dsn = 'DBI:mysql:test;host=localhost;port=3306';
my $username = 'root';
my $password = '0';
my $attributes = {RaiseError=>1, AutoCommit=>1};
my $dbn = DBI->connect($dsn, $username, $password, $attributes);
可是密码没有错误,
寻找原因可能是密码过短,所以将mysql的密码修改长一点,如‘123456’,
之后就OK了