连接失败:用户'root'访问被拒绝@'localhost'(使用密码:NO)“在wordpress中[重复]

I have got error when try to insert data using PHP code to wordpress database.

Error like this :

Connect failed: Access denied for user 'username'@'localhost' (using password: NO)” in wordpress

How can I fix this.

I'm working on live server.

</div>

Check your config.php in the main folder and look for this lines if there configure correctly.

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

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

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