Closed KongYian closed 7 years ago
I tested this issue. The reason is because you are using wrong configuration for the server
option.
For example:
// This works fine
mysql:host=localhost;dbname=foo;
// Invalid host name, throw error
mysql:host=localhostttt;dbname=foo;
// Invalid host name also, but connect successfully
mysql: host=localhostttt;dbname=foo;
mysql:xhost=localhost;dbname=foo;
Adding whitespace before host is just making the host value as invalid, and the PDO engine will connect the localhost by default.
So, check out the server
option is correct or not again.
yeasterday,l connected my mysql server.This problem showed. After my debug,l confirm that this problem is caused by a wrong
$dsn
. u can see this blog http://blog.csdn.net/gusgao/article/details/52435812 . add a space beforehost
and exchange params namedhost
&dbname
. l modified source code at column 213$dsn = $driver . ': ' . implode($stack, ';');
and add$attr = array_reverse($attr,true);
at column 200 in Medoo.php. At last , l figured out it. u can check it. Thx.