Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 17, 2024 via pnpm

mysql2 3.6.1

fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS
Package summary
Share
1
issue
1
critical severity
license
1
4
licenses
7
MIT
2
Apache-2.0
2
ISC
1
N/A
Package created
17 Apr 2013
Version published
9 Sep 2023
Maintainers
3
Total deps
12
Direct deps
8
License
MIT

Issues

1

1 critical severity issue

critical
Recommendation: Check the package code and files for license information
via: seq-queue@0.0.5
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
7 Packages, Including:
generate-function@2.3.1
iconv-lite@0.6.3
is-property@1.0.2
mysql2@3.6.1
named-placeholders@1.1.3
safer-buffer@2.1.2
sqlstring@2.3.3

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
2 Packages, Including:
denque@2.1.0
long@5.2.3

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
lru-cache@7.18.3
lru-cache@8.0.5

N/A

N/A
1 Packages, Including:
seq-queue@0.0.5
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

8
All Dependencies CSV
β“˜ This is a list of mysql2 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
denque2.1.09.01 kBApache-2.0
prod
generate-function2.3.13.55 kBMIT
prod
iconv-lite0.6.3186.2 kBMIT
prod
long5.2.324.15 kBApache-2.0
prod
lru-cache8.0.5133.41 kBISC
prod
named-placeholders1.1.32.96 kBMIT
prod
seq-queue0.0.55.31 kBUNKNOWN
prod
1
sqlstring2.3.36.22 kBMIT
prod

Visualizations

Frequently Asked Questions

What does mysql2 do?

MySQL2 is a robust MySQL client for Node.js, putting an exclusive focus on performance. It supports features such as prepared statements, non-UTF8 encodings, binary log protocol, data compression, and SSL among others. MySQL2 is free from native bindings, meaning it can be smoothly installed on Linux, Mac OS, or Windows without any issues.

How do you use mysql2?

To use MySQL2, you first need to install it by running the command npm install --save mysql2. Once installed, you can start incorporating it in your code as follows:

// importing the client
const mysql = require('mysql2');

// creating a connection to your database
const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  database: 'test'
});

// executing a simple query
connection.query(
  'SELECT * FROM `table` WHERE `name` = "Page" AND `age` > 45',
  function(err, results, fields) {
    console.log(results); // returns rows provided by the server
    console.log(fields); // contains extra meta data about results, if available
  }
);

// executing a query with a placeholder
connection.query(
  'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',
  ['Page', 45],
  function(err, results) {
    console.log(results);
  }
);

For more advanced usages such as using prepared statements, connection pools, Promise wrapper, and more, refer to the code provided in the readme.

Where are the mysql2 docs?

The MySQL2 documentation can be found directly here in the GitHub repository. It provides comprehensive insights on how to use the package, including a multitude of code examples for understanding advanced concepts. Also, the readme provides a precise overview of the package, starting from installation and basic usage, to more advanced topics. For TypeScript users, there's also a separate TypeScript documentation with relevant code examples.