I use php tool for develop template for wordpress . I create new php project into visual studio and replace all file of wordpress inside it. Now when run project get this error :

Error establishing a database connection

wp-config.php :

define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

With this options worked in wampserver but into vs no.

How to fix this?

Read more here: Error establishing a database connection (php tool)


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: