PHPackages                             motomedialab/maxscale-connector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. motomedialab/maxscale-connector

ActiveLibrary[Database &amp; ORM](/categories/database)

motomedialab/maxscale-connector
===============================

Fixes database connection errors when routing Laravel database connections via MariaDB MaxScale

v1.0.2(5y ago)05941MITPHPPHP ^7.3

Since Sep 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/motomedialab/maxscale-connector)[ Packagist](https://packagist.org/packages/motomedialab/maxscale-connector)[ RSS](/packages/motomedialab-maxscale-connector/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

Laravel MariaDB MaxScale Connector
==================================

[](#laravel-mariadb-maxscale-connector)

A simple package designed to provide a fix for the existing `Illuminate\Database\Connectors\MySQLConnector` class.

When connecting to MaxScale using Laravel, the `$connection->exec("use {$config['database']};");` command is run, not only creating a surplus query but also triggering a database connection error when using MariaDB MaxScale. Within MaxScale logs, you'll see an error similar to:

```
error  : (1) Invalid authentication message from backend 'your-backend'. Error code: 1044, Msg : #42000: Access denied for user 'username'@'%' to database '`database_name`'

```

The reason for this, is that Laravel is trying to establish a connection with '`database\_name`' (backticks) when it should simply be connecting to 'database\_name' (no backticks).

As the database name has already been declared within the PDO DSN (see [PR #34389](https://github.com/laravel/framework/pull/34389)), the offending line of code is effectively surplus to requirements already. All this package does is remove the surplus database selection by overriding the existing MySQL connector to remove the offending lines of code.

Installation
------------

[](#installation)

Install via composer `composer require motomedialab/maxscale-connector`

Within your `config/database.php` you have two options:

1. Update your `database.connections.mysql.driver` config flag to `maxscale`
2. Create a new configuration for MaxScale

    1. Copy the entire `database.connections.mysql` config array
    2. Rename the key to `maxscale`
    3. Change the driver flag `database.connections.maxscale.driver` to `maxscale`
    4. Update your `.env` file to reflect this change, e.g. `DB_CONNECTION=maxscale`

Once one of the above options have been completed, you should be able to connect to your MaxScale instance via Laravel no problem.

### Notes

[](#notes)

- While this package was built to resolve Laravel MaxScale issues, the package will still work with MySQL and remove the surplus query being performed on each load

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2115d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2487374?v=4)[Chris Page](/maintainers/chrispage1)[@chrispage1](https://github.com/chrispage1)

---

Top Contributors

[![chrispage1](https://avatars.githubusercontent.com/u/2487374?v=4)](https://github.com/chrispage1 "chrispage1 (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/motomedialab-maxscale-connector/health.svg)

```
[![Health](https://phpackages.com/badges/motomedialab-maxscale-connector/health.svg)](https://phpackages.com/packages/motomedialab-maxscale-connector)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
