Creating a Database and User

# Step 1: Login to MySQL/MariaDB as root
user@server:~$ mysql -u root -p
# It will prompt you for your database root password
Enter password:
# Step 2: Create the Database
create database snipeit;
# Step 3: Verify that it was created correctly
show databases;
# Step 4: Create the Snipe-IT user
create user snipe_user;
# Step 5: Grant privileges while assigning the password
grant all on snipeit.* to 'snipe_user'@'localhost' identified by 'YOUR_DB_PASSWORD_HERE';
📘

The localhost field usually doesn’t have to be edited, but you can set it to the specific address.

In the example above, your database settings in your .env would look like this:

DB_DATABASE=snipeit
DB_USERNAME=snipe_user
DB_PASSWORD=YOUR_DB_PASSWORD_HERE