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

create user identified WITH mysql_native_password not work #7295

Closed
jackysp opened this issue Aug 7, 2018 · 0 comments
Closed

create user identified WITH mysql_native_password not work #7295

jackysp opened this issue Aug 7, 2018 · 0 comments

Comments

@jackysp
Copy link
Member

jackysp commented Aug 7, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    public void testBug19354014() throws Exception {
        if (versionMeetsMinimum(5, 5, 7)) {
            Connection con = null;
            createUser("'bug19354014user'@'%'", "identified WITH mysql_native_password");
            this.stmt.executeUpdate("grant all on *.* to 'bug19354014user'@'%'");
            this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER 'bug19354014user'@'%' IDENTIFIED BY 'pwd'"
                    : "set password for 'bug19354014user'@'%' = PASSWORD('pwd')");
            this.stmt.executeUpdate("flush privileges");

            try {
                Properties props = new Properties();
                props.setProperty("useCompression", "true");

                con = getConnectionWithProps(props);
                ((MySQLConnection) con).changeUser("bug19354014user", "pwd");
            } finally {
                this.stmt.executeUpdate("flush privileges");

                if (con != null) {
                    con.close();
                }
            }
        }
    }
  1. What did you expect to see?
    It should be OK.

  2. What did you see instead?
    createUser("'bug19354014user'@'%'", "identified WITH mysql_native_password"); return an syntax error. "java.sql.SQLException: line 1 column 50 near " mysql_native_password" (total length 72)"

  3. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    ae2e3ac

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

No branches or pull requests

1 participant