$dsn = "DBI:mysql:test;mysql_read_default_file=/home/joe/my.cnf";
$dbh = DBI->connect($dsn, $user, $password)
# file my.cnf
[client]
host = 192.168.2.123
port = 3306
database = server
user = root
#password = your_password
default-character-set = utf8
本文介绍如何使用 Perl 的 DBI 模块连接 MySQL 数据库,并展示了具体的配置文件及连接代码示例。
3306

被折叠的 条评论
为什么被折叠?



