Dear Everyone,
When i am trying to connect MySQL database from splunk db connect. MySQL is on another server.
Error is
ERROR java.sql.SQLException: Access denied for user 'root'@'xx.xx.xx.xxx' (using password: NO)
Can anyone please help me on this.
Thanks
Gajanan Hiroji.
If you are connecting a remote mysql server from your local machine using java see the below steps. Error : "java.sql.SQLException: Access denied for user 'xxxxx'@'101.123.163.141' (using password: YES) "
for remote access may be cpanel or others grant the remote access for your local ip address.
In the above error message: "101.123.163.141" is my local machine ip. So First we have to give remote access in the Cpanel-> Remote MySQL®. Then run your application to connect.
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(
"jdbc:mysql://www.xyz.com/abc","def","ghi");
//here abc is database name, def is username and ghi
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from employee");
while(rs.next())
System.out.println(rs.getInt(1)+" "+rs.getString(2)+"
"+rs.getString(3));
con.close();
Hope it will resolve your issue.
Thanks
I am facing similar problem. Have you solved it?
Encountered the following error while trying to save: In handler 'databases': Error connecting to database: java.sql.SQLException: Access denied for user 'root'@'' (using password: YES)
Pls help!!!
Have you granted access to the database? For example, 'grant all privileges on database.* to root@machine.splunk.runs.on;
I am trying to connect from one ec2 machine to another ec2 machine
Ther was way to add username password.
First i have connected to localhost database using host as 127.0.0.1. now i am trying to connect to 54.35.xx.xxx Mysql database but i m getting this error.
ERROR java.sql.SQLException: Access denied for user 'root'@'50.16.35.xxx' (using password: NO)
In error massage its trying to connect my local machine again because my local machine IP address is 50.16.35.xxx instead of 54.35.xx.xxx
Can anyone please tell me how this is happening.
When you added the connection there was no way to enter the username and password?
http://docs.splunk.com/Documentation/DBX/latest/DeployDBX/Addadatabaseconnection
When i have given different machine IP address to add the database but it is taking local machine and checking the user in local machine.