Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
598 views
in Q2A Core by

Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'qa-tuts'@'localhost' (using password: YES) in C:\xampp\htdocs\qa-tuts\qa-include\qa-db.php on line 83

Could not establish database connection. Please check the username, password and hostname in the config file, and if necessary set up the appropriate MySQL user and privileges.

I want new code qa-db.php

Q2A version: Question2Answer 1.7.4

2 Answers

+1 vote
by
selected by
 
Best answer

May be mistaken QA_MYSQL_USERNAME and QA_MYSQL_PASSWORD in qa-config.php. Default settings in XAMPP is blow.

  • QA_MYSQL_USERNAME: "root"
  • QA_MYSQL_PASSWORD: "" (blank)

Common installation mistakes are below.

  1. QA_MYSQL_HOSTNAME
    > If Database(MySQL) exists on the same hardware with web server, you should specify "localhost". However, if Database (MySQL) is on a different hardware from web server, you should specify specific IP address. It seems that you are using XAMPP on your PC, so probably "localhost" is correct.
  2. Port number for connection of MySQL (Default: 3306)
    > Look at http://www.question2answer.org/qa/44900/.  If you have not changed default port of XAMPP, you do not need to specify.
  3. QA_MYSQL_USERNAME and QA_MYSQL_PASSWORD
    > These are ID and password for connecting to the database. It is different from user handle and password of apache user and initial Q2A administrator. Default ID of XAMPP is "root". Default password is "" (blank). If you had change password of root user, you need to specify it's password. If you add a new connection user with phpMyAdmin, you need to give all the privileges to that user with phpMyAdmin.
  4. QA_MYSQL_DATABASE
    > Specify database name which you created with phpMyAdmin.
+1 vote
by
check your qa-config.php file first. it looks connecting to db issue. are you installing on windows server?
by
I don't understand.
Can you give me 1 new code. (qa-db.php)
...