Skip to content

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

@jonasfrey

Description

@jonasfrey

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions