Q: Why is Errorestablishingadatabaseconnection reported when typecho is installed for the first time?

Source: Internet
Author: User
& Quot; Errorestablishingadatabaseconnection & quot; the error indicates that a database connection error is established. & quot; ask how to solve this problem.


"Error establishing a database connection" indicates "An Error occurred while establishing a database connection"
Ask how to solve this problem

Reply content:


"Error establishing a database connection" indicates "An Error occurred while establishing a database connection"
Ask how to solve this problem

I found the code. It is estimated that your user name, password, or database name is not set accurately.

Public function connect (Typecho_Config $ config) {if ($ this-> _ dbLink = @ mysql_connect ($ config-> host. (empty ($ config-> port )? '':':'. $ Config-> port), $ config-> user, $ config-> password, true) {if (@ mysql_select_db ($ config-> database, $ this-> _ dbLink) {if ($ config-> charset) {mysql_query ("set names '{$ config-> charset }'", $ this-> _ dbLink);} return $ this-> _ dbLink ;}} /** database exception */throw new Typecho_Db_Adapter_Exception (@ mysql_error ($ this-> _ dbLink ));}

From www.typechodev.com

@ TypechoDev

I made a mistake. It is indeed because my user name, password, or database name is not set correctly. Now you can install it. Thank you.

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.