Skip to content
pubscout

mysql_dart

4.0.1, released 3 weeks ago by an unverified publisher

Native MySQL and MariaDB client written in Dart.

Unverified publisher
$ flutter pub add mysql_dart
Source repository

What it does

Connects directly to MySQL and MariaDB databases without external runtime dependencies. Supports connection pooling, transactions, TLS encryption, prepared statements, and result-set streaming.

AI-written summary of version 4.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a pure Dart MySQL or MariaDB client for backend or client-side use
  • You require connection pooling and real prepared statements
  • You need TLS support and modern authentication plugins like caching_sha2_password

Skip it when

  • You are using a different database engine such as PostgreSQL or SQLite
  • Exposing database credentials directly in client applications is insecure

Strengths

  • Zero external runtime dependencies
  • Supports connection pooling, transactions, and result streaming with backpressure
  • High performance AOT-compiled query execution

Weaknesses

  • Older database servers might require TLS configuration adjustments or `secure: false` on trusted networks
  • Exposing direct database ports to the internet is dangerous

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Requires network access to a MySQL or MariaDB server and proper connection credentials.

final pool = MySQLConnectionPool(
  host: '127.0.0.1',
  port: 3306,
  userName: 'your_user',
  password: 'your_password',
  maxConnections: 10,
);
var result = await pool.execute('SELECT * FROM book WHERE id = :id', {'id': 1});

Alternatives

Packages that do the same job and could replace mysql_dart.

Works with

Packages commonly used together with mysql_dart: ones it builds on, ones built on it, and its own family.