1. $dsn = " mysql:dbname=test1;host=localhost"; (mysql前多一个空格会提示:) 转载于:https://www.cnblogs.com/gaojunshan/p/6041495.html