Skip to content

Database

Mischa Braam edited this page Feb 16, 2024 · 6 revisions

You can choose your from the following supported RDBMS-es during installation.

  • MySQL 5.7 (default)
  • MySQL 8.0
  • MySQL 8.1
  • MariaDB

Valet+ automatically installs MySQL 5.7 with 5.6 compatibility mode included. It includes a tweaked my.cnf which is aimed at improving speed.

Username: root Password: root

Change password

valet-plus db password <old> <new>
valet-plus db pwd <old> <new>

List databases

valet-plus db list
valet-plus db ls

Creating databases

valet-plus db create
valet-plus db create <name>

When no name is given it'll try to find the closest git repository directory name. When it can't find one it'll use the current working directory name.

Dropping databases

valet-plus db drop
valet-plus db drop <name>

When no name is given it'll try to find the closest git repository directory name. When it can't find one it'll use the current working directory name.

Resetting databases

Drop and create a new database.

valet-plus db reset
valet-plus db reset <name>

When no name is given it'll try to find the closest git repository directory name. When it can't find one it'll use the current working directory name.

Exporting databases

valet-plus db export <filename> <database>
valet-plus db dump <filename> <database>

When no database name is given it'll try to find the closest git repository directory name. When it can't find one it'll use the current working directory name.

When no filename is given it will use <database>-<date>.sql.gz. Optionally you can use valet db export - <database> to automatically generate the filename for a custom database.

All database exports are gzipped.

Importing databases

Import a database with progress bar.

valet-plus db import <filename>.sql(.gz) <name>

When no name is given it'll try to find the closest git repository directory name. When it can't find one it'll use the current working directory name.

You can import .sql directly as well as gzipped .sql.gz database exports.

Clone this wiki locally