Thinkphp framework is used for thinkphp database problems. An error occurs during newModel. The information in Exception seems to be & quot; Accessdeniedforuser 'root' @ 'localhost' (usingpassword: NO) & quot; but my thinkphp database problems
Use the thinkphp framework. An error occurs when new Model () is created.
The information in Exception seems to be
"Access denied for user 'root' @ 'localhost' (using password: NO )"
However, I have configured the information in config. php.
The database name is test and the table is think_em.
PHP code
PHP code
'Configuration value' DB _ type' => 'mysql', 'DB _ host' => 'localhost', 'DB _ name' => 'test ', 'db _ user' => 'root', 'DB _ pwd' => 'Welcome ', 'DB _ port' => '123 ', 'db _ prefix' => 'think _ ', 'app _ debug' => true,);?>
------ Solution --------------------
1: The above error indicates that the password is incorrect. check the password and port.
2: new Model (''); changed to: $ test = M ('em ');
------ Solution --------------------
Delete all content in Runtime and try again