James Linden

~# linux ninja / web dev geek / robotics nerd / idea machine / N6NRD

Code / MySQL Database/User Quick Deploy

MySQL Database/User Quick Deploy

Overview

The MySQL Database/User Quick Deploy is a simple BASH script to create a new database and user easily.

Environment

  • Linux
  • BASH
  • MySQL or MariaDB

Notes

  • This script is designed to run on the command line.
  • This script grants user access to '%' host. Modify the script to secure for your local environment.

Howto

Download mysqlquickdeploy.sh.

Parameters

name required description
database yes The name you want to use for your new database
user yes Username to create and give access to the database
password yes Password to give the new user
import_file no If supplied, and the file exists, import import_file into the new database

If the specified database or username already exist, the script will warn and exit.

Usage

Basic

mysqlquickdeploy putdatahere theuser secretpass

With SQL file import

mysqlquickdeploy putdatahere theuser secretpass data.sql

License

This project is BSD (2 clause) licensed.

photo of James Linden
Founder / Head Geek
Digital Dock, LLC
aka kodekrash & N6NRD
Perkasie, PA USA

What I Do

Linux administration/virtualization
Datacenter management
Web development

Full CV

What I've Done

Drowned a motorcycle
Rescued a skunk
Built Prime GNU/Linux
Contributed to Spidering Hacks