MariaDB is a drop-in, fully compatible replacement for MySQL, and it’s the default database engine for many Linux distributions. Many popular hosting platforms like Laravel Forge support MariaDB databases out of the box, making the switch from local to production a breeze.
Herd provides a sensible default configuration for your MariaDB instance that works seamlessly for new setups, and you can change the port of the service to run it in parallel to existing installations on your machine.Enabling the autostart option automatically starts a service instance when you start Herd.If you want to modify the settings of the database, you can right click the service in the settings and open its data directory. In this data directory, there is a my.cnf that this specific MariaDB instance loads on startup.Make sure to restart the service if you make changes to this configuration.
While Laravel applications can create a database when running the migrations for the first time, it’s a good practice to set up the database within the database instance yourself.The service details on the right side of the selected service allow you to open TablePlus or AdminerEvo with a single click. Herd automatically detects TablePlus on your machine and provides a connection string to access the database instance. If you don’t use TablePlus, it opens AdminerEvo where it inserts the correct login credentials for you.
To connect your application to the server, you can use the credentials that are listed next to the running service in the settings, or you can use the ones below.
Copy
Ask AI
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3307DB_DATABASE=laravel # set this to your project databaseDB_USERNAME=rootDB_PASSWORD=
Whether you set up a newer version of MariaDB or migrate from existing instances on your machine, the most comfortable way is to use a database client like TablePlus to export and import the database tables.
If you want to access your MariaDB instance via the command line or use squashed migrations, you need to add the mariadb binary to your path. The CLI tool it at the following location:
You can add the path to the binary to your PATH by running the following commands in Powershell or CMD. Please make sure to restart your terminal session after changing the PATH variable so that the terminal loads the new value.