3

I am on Windows 10 desktop with a Cloudera VM running on it. From inside the coudera vm Linux OS, I can login to MySQL with:

mysql -ucloudera -pcloudera

When I try to connect to the MySQL inside Cloudera VM from my windows machine, using JDBC, I get this error: (my windows computer name is a TV with no domain name)

java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'cloudera'@'tv.lan' (using password: YES))

jdbc:mysql://quickstart.cloudera:3306/infa_mdm user = cloudera password = cloudera

How do I disable this automatic addition of domain name at the end? Or is there any other way to resolve this?

Below is Apache JMeter's JDBC connection config: enter image description here

3
  • I avoided the problem for now, by adding a mysql user with the domain name and GRANTed all privileges as per: stackoverflow.com/questions/16287559/… But that would not solve the problem in a real life project. Commented Feb 10, 2019 at 2:20
  • I am using Apache JMeter's JDBC Config to setup the JDBC connection ( edited Question to include the photo of JDBC connection). there are few text boxes: URL = jdbc:mysql://quickstart.cloudera:3306/infa_mdm User = cloudera, Pass = cloudera Commented Feb 10, 2019 at 2:23
  • AFAIK you can't, because - again AFAIK - it is determined by MySQL server, not by the client (if the client could, that would be a severe security issue). You'll need to explicitly grant to this combination (or grant to the less secure 'cloudera'@'%'). It works in the first case because MySQL will infer that as 'cloudera'@'localhost' or something like that. Commented Feb 10, 2019 at 10:04

1 Answer 1

1

GRANT privilegies to 'cloudera'@'tv.lan'
Thats because of MySQL's have the host based permission. Each Username and its Hostname stored in a separate column in the mysql.users table, so if you want to be able to log in to MySQL from tv.lan computer on behalf of cloudera user, you need to give access permission to this user and this hostname -

As documentation says:

An account when first created has no privileges and a default role of NONE. To assign privileges or roles, use the GRANT statement.

Each account name uses the format described in Section 6.2.4, “Specifying Account Names”. For example:

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'password';

The host name part of the account name, if omitted, defaults to '%'.

Check this Data Base JMeter testing tips for additional information:
- Building a Database Test Plan
- JMeter Database Testing
- JMeter Cloud testing your DB

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.