MySQL configuration settings. Access denied

Hello
i have installed mysql plugin in my cpanel server,
but that plugn unable to get data, here is the error it is showing.
[2017-01-28 14:39:57,638] ERROR com.newrelic.plugins.mysql.MySQL - Unable to obtain a new database connection: jdbc:mysql://127.0.0.1/ newrelic/PASSWORD_FILTERED, check your MySQL configuration settings. Access denied for user ‘newrelic’@‘localhost’ (using password: YES)
[2017-01-28 14:40:57,496] ERROR com.newrelic.plugins.mysql.MySQL - Unable to obtain a new database connection: jdbc:mysql://127.0.0.1/ newrelic/PASSWORD_FILTERED, check your MySQL configuration settings. Access denied for user ‘newrelic’@‘localhost’ (using password: YES)

i habe tried localhost, and server ip also,

Hey @himanshu1,

Have you gone through the process of creating the newrelic user on your mysql server instance?

You need to run the following script from your mysql command line:

CREATE USER newrelic@localhost IDENTIFIED BY PASSWORD '*B8B274C6AF8165B631B4B517BD0ED2694909F464';
GRANT PROCESS,REPLICATION CLIENT ON *.* TO newrelic@localhost;
CREATE USER newrelic@127.0.0.1 IDENTIFIED BY PASSWORD '*B8B274C6AF8165B631B4B517BD0ED2694909F464';
GRANT PROCESS,REPLICATION CLIENT ON *.* TO newrelic@127.0.0.1;

With these default credentials you don’t need to specify a user and passwd on your plugin.json file.
If you want to use a different user and pass, just create it using the above permissions and add it to the plugin.json.

You can find more info here:

Cheers,

Hi ,I am facing the same issue.
I have created user and granted permissions using the above queries.

below is the error log details
[2020-05-22 11:21:54,347] DEBUG com.newrelic.metrics.publish.Runner - Setting up agents to be run
[2020-05-22 11:21:54,379] DEBUG com.newrelic.plugins.mysql.instance.MySQLAgent - MySQL Agent initialized: name: Localhost | host: 127.0.0.1 | user: newrelic | properties: | metrics: [newrelic, status] |
[2020-05-22 11:21:54,379] DEBUG com.newrelic.metrics.publish.AgentFactory - Created agent: com.newrelic.plugins.mysql.instance.MySQLAgent@5e91993f
[2020-05-22 11:21:54,388] DEBUG com.newrelic.metrics.publish.Agent - Preparing to run
[2020-05-22 11:21:54,388] DEBUG com.newrelic.metrics.publish.Agent - Setting up metrics
[2020-05-22 11:21:54,397] DEBUG com.newrelic.metrics.publish.Runner - Harvest and report data
[2020-05-22 11:21:54,398] DEBUG com.newrelic.metrics.publish.Runner - Beginning poll cycle for agent: ‘Localhost’
[2020-05-22 11:21:54,399] DEBUG com.newrelic.plugins.mysql.MySQL - Getting new MySQL Connection: jdbc:mysql://127.0.0.1/ newrelic/PASSWORD_FILTERED
[2020-05-22 11:21:55,161] ERROR com.newrelic.plugins.mysql.MySQL - Unable to obtain a new database connection: jdbc:mysql://127.0.0.1/ newrelic/PASSWORD_FILTERED, check your MySQL configuration settings. Unable to load authentication plugin ‘caching_sha2_password’.
[2020-05-22 11:21:55,162] DEBUG com.newrelic.metrics.publish.Runner - Ending poll cycle for agent: ‘Localhost’
[2020-05-22 11:21:55,162] DEBUG com.newrelic.metrics.publish.binding.Request - No metrics were reported for this poll cycle

I have changed the host from localhost to 27.0.0.1 also but no luck. I have mysql database running in my localhost only in this case what host should be given
please suggest.

below is the plugin.json details:

“agents”: [
{
“name” : “localhost”,
“host” : “127.0.0.1”,
“metrics” : “status,newrelic”,
“user” : “newrelic”,
“passwd” : “*****”
}
]

Thanks,
Rakesh

Hi Rakesh,

It looks like you are using the older MySql plugin, this and other plugins are no longer actively developed.

The newer MySQL Integration is the recommended way to monitor your MySQL DBs, and should get you even more data than the plugin would.

Could you try that out and see if you hit any errors with this?

https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/mysql-monitoring-integration

1 Like

@RyanVeitch, My Mysql database is running on localhost which is windows 7. How can i install in this case?

Thanks,
Rakesh

Hi @rakeshcse590

Windows may be a challenge. The Integrations don’t natively support Windows.

With that said, they are open source, you can grab the code here: https://github.com/newrelic/nri-mysql

You may be able to compile and run it locally (since they are mostly written in Go, you’ll need to be able to compile go).

1 Like