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

Error: Not supported when trying to connect with wrong username #151

Open
jonasfrey opened this issue Feb 16, 2023 · 0 comments
Open

Error: Not supported when trying to connect with wrong username #151

jonasfrey opened this issue Feb 16, 2023 · 0 comments

Comments

@jonasfrey
Copy link

i have the following users setup in my mysql db

select * from mysql.user;
+-----------+------------------
| Host      | User             
+-----------+------------------
| localhost | debian-sys-maint 
| localhost | mysql.infoschema 
| localhost | mysql.session    
| localhost | mysql.sys        
| localhost | root             
+-----------+------------------

when i now try to connect with a wrong non-existing user i get no error at all

const client = await new Client().connect({
  hostname: "127.0.0.1",
  username: "testuser",
  password: "Test12342",
});

when i then try to execute a sql query i get the following uninformative error message:

await client.execute(`CREATE DATABASE IF NOT EXISTS enok`);
error: Uncaught (in promise) Error: Not supported
      throw new Error("Not supported");
            ^
    at auth (https://deno.land/x/mysql@v2.11.0/src/auth.ts:41:13)
    at PoolConnection._connect (https://deno.land/x/mysql@v2.11.0/src/connection.ts:118:24)
    at async PoolConnection.connect (https://deno.land/x/mysql@v2.11.0/src/connection.ts:179:5)
    at async Client.createConnection (https://deno.land/x/mysql@v2.11.0/src/client.ts:47:5)
    at async DeferredStack.creator (https://deno.land/x/mysql@v2.11.0/src/pool.ts:67:20)
    at async DeferredStack.pop (https://deno.land/x/mysql@v2.11.0/src/deferred.ts:35:16)
    at async ConnectionPool.pop (https://deno.land/x/mysql@v2.11.0/src/pool.ts:99:14)
    at async Client.useConnection (https://deno.land/x/mysql@v2.11.0/src/client.ts:105:24)
    at async Client.execute (https://deno.land/x/mysql@v2.11.0/src/client.ts:96:12)

i would expect the following message

error: Uncaught (in promise) Error: Access denied for user 'testuser'@'localhost' (using password: YES)

i found out that this happens only for the strings 'testuser*' and 'root*', so for example username 'a_root' would give the correct error, or username 'a_testuser'

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

No branches or pull requests

1 participant