Installing Infrastructure agent required however, the guided install automatically installs the new relic ionfrastruc ture agent.
New relic mysql Guided Install
Createe New account with New relic, Click on settings and slect Add more data
Then select mysql.
Copy & Paste mysql New relic installation Command
curl -Ls https://raw.githubusercontent.com/newrelic/newrelic-cli/master/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=NRAK-Q8QNCMEW58VMJ2A5ORFQUWNOH9W NEW_RELIC_ACCOUNT_ID=3034122 /usr/local/bin/newrelic install -n mysql-open-source-integration
Step 2: Create mysql User & Grant Permissions
on installation it asks run the below commands
if you are stuck at Creating mysql user & permissions check this tutorial.
ERROR 1141 (42000): There is no such grant defined for user ‘newrelic’ on host ‘%’
The above error may appears.
Step 3: Provide the mysql database details to new relic terminal
2nd way New relic mysql Integration
first install new relic infrastructure agent
find the host integration name for mysql
ex: nri-mysql
2.1 create mysql user and grant replication permissions
login to mysql root
mysql -u root -p
and run the following commands without erroors.
2.2 install newrelic mysql agent
sudo apt-get install nri-mysql
2.3 Configure new relic mysql integrations
cd /etc/newrelic-infra/integrations.d
cp newrelic-mysql.sample newrelic-mysql.yml
nano newrelic-mysql.yml
integration_name: com.newrelic.mysql
instances:
– name: mysql-status
command: status
arguments:
hostname: localhost
port: 3306
username: newrelic
password: your password
Below metric addeed if you succeed with auto guided install or you can manually configure it.
database: naukri
extended_metrics: true
extended_innodb_metrics: true
extended_myisam_metrics: true
remote_monitoring: true
Restart new relic infrastructure agent
sudo systemctl restart newrelic-infra
How to mysql data in new relic Dashboard
New Relic Home >> Infrastructure
> Third party service >>
There will be appear mysql or redisor any integrations.
Problem new relic mysql integration
Download the new relic diagnosis tool
on ubuntu linux and windows server. and run this will diagnose the situation, take a screenshot and send it to the new relic support.
syslog errors
newrelic-infra-service[16510]: time=”2021-05-07T13:56:30Z” level=error msg=”Integration command failed” error=”exit status 1″ instance=mysql-status integration=com.newrelic.mysql prefix=config/mysql stderr=”[FATAL] can’t continue: error querying inventory: error executing `SHOW GLOBAL VARIABLES`: dial tcp 127.0.0.1:3306: connect: connection refused\n” working-dir=/var/db/newrelic-infra/newrelic-integrations.
here not listening on tcp but on unix socket
vi /etc/mysql/my.cnf
#bind-address = 127.0.0.1
OR
$ vi /etc/mysql/mysql.conf.d/mysqld.cnf
uncomment it.
Most problems you mY FACE WITH MYSQL Commands.
integration_name=nri-mysql stderr=”[FATAL] can’t continue: error querying inventory: error executing `SHOW GLOBAL VARIABLES`: Error 1045: Access denied for user ‘newrelic’@’127.0.0.1′ (using password: YES)”
newrelic’@’127.0.0.1′ vs newrelic’@’localhost’
change password in mysql
ALTER USER ‘newrelic’@’localhost’ IDENTIFIED BY ‘NewPassword’;