Skip to content

Database

Toan Nguyen edited this page Apr 15, 2024 · 1 revision

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

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

Valet Pro Max 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-pro db password <old> <new>
valet-pro db pwd <old> <new>

List databases

valet-pro db list
valet-pro db ls

Creating databases

valet-pro db create
valet-pro 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-pro db drop
valet-pro 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-pro db reset
valet-pro 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-pro db export <filename> <database>
valet-pro 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-pro 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