Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to MySQL w/o password #81

Open
erycson opened this issue Jun 24, 2017 · 4 comments
Open

Connect to MySQL w/o password #81

erycson opened this issue Jun 24, 2017 · 4 comments

Comments

@erycson
Copy link

erycson commented Jun 24, 2017

Hi guys,

Today I met an issue to connect to MySQL Server 5.7.17 using account w/o password. I got next log error:

Error 1045 - #28000 - Access denied for user 'root'@'localhost' (using password: YES)

My conf.json:

{
    "database": {
        "host": "127.0.0.1",
        "port": 3306,
        "maxPoolSize": 1,
        "username": "root",
        "password": "",
        "database": "testdb"
    }
}

Java:

        SQLClient client = MySQLClient.createNonShared(vertx, config().getJsonObject("database"));
        client.getConnection(result -> {
            if (result.failed()) {
                logger.info("ERROR");
                fut.fail(result.cause());
            } else {
                logger.info("OK");
            }
        });

P.S. I'm using Vertx 3.4.2, vertx-mysql-postgresql-client 3.4.2.

@Narigo
Copy link
Contributor

Narigo commented Jun 26, 2017

Did you try not to provide the line "password": "", in your JSON?

@erycson
Copy link
Author

erycson commented Jun 26, 2017

Give the same error

@Narigo
Copy link
Contributor

Narigo commented Sep 3, 2017

I've tried to set String DEFAULT_PASSWORD = null; instead of String DEFAULT_PASSWORD = "password"; in io.vertx.ext.asyncsql.MySQLClient, which showed errors in test com.github.mauricio.async.db.mysql.exceptions.MySQLException: Error 1045 - #28000 - Access denied for user 'vertx'@'localhost' (using password: NO). I've tried a few variations on docker run commands for MySQL but could not manage to connect to one. Can you try to change the line mentioned above and see if it would work with your setup?

@thesowah
Copy link

Try to set the password to null instead of the empty string
{
"database": {
"host": "127.0.0.1",
"port": 3306,
"maxPoolSize": 1,
"username": "root",
"password": null,
"database": "testdb"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants