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 yesterday

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 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

2062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/805ae1048fb81d8f02871f57cc0a34699089da17f7021210e554ffdba4df918a?d=identicon)[chrispage1](/maintainers/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

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

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