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

Connection failure does not throw error #45

Closed
jerrythomas opened this issue May 15, 2020 · 4 comments
Closed

Connection failure does not throw error #45

jerrythomas opened this issue May 15, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@jerrythomas
Copy link

The following code snippet does not raise any error when the MySQL server is not running or if it refuses the connection.

      try {
        const db = await new Client().connect({username: "root"});
      } catch (err) {
        console.error(err);
      }

The error is raised only when a query is fired.

      try {
        const db = await new Client().connect({username: "root"});
        const result = await db.query("show variables like 'version';")
      } catch (err) {
        console.error(err);
      }

Is this intended behaviour? If yes why does creating the connection not throw an error? It also does not show the error that it is accessing the localhost URL when running without any permissions.

@manyuanrong manyuanrong added the enhancement New feature or request label May 15, 2020
@sarthaksavvy
Copy link

I am also getting Same error

error: Uncaught Error: Not supported throw new Error("Not supported");

mysql --version
mysql Ver 8.0.19 for osx10.15 on x86_64

@manyuanrong
Copy link
Member

@sarthaksavvy Currently does not support the default authentication plugin for mysql 8.0 #37

@sarthaksavvy
Copy link

@manyuanrong thanks man, waiting for mysql 8 support, please do it fast

@lideming
Copy link
Collaborator

It is intended. new Client().connect() does not create the connection but the connection pool.

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

No branches or pull requests

4 participants