Thinkphp database problems

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.