/ Published in: Bash
**Usage**
> newuser.bash [username]
**What it does**
- Generates a random password with `makepasswd`
- Encrypts it with `mkpasswd` for use with useradd
- Adds the user
- Adds a MySQL Database for user
- Adds a MySQL User for user
- Grants all privileges to user to his/her database
**Sample Output**
km@KM-VBox:~$ ./newuser.bash test1
Creating user: test1
Password: zV8MDMRh
[sudo] password for km:
Creating mysql user & database for test1
[Short demo on Screenr (1min)](http://screenr.com/ghzs)
> newuser.bash [username]
**What it does**
- Generates a random password with `makepasswd`
- Encrypts it with `mkpasswd` for use with useradd
- Adds the user
- Adds a MySQL Database for user
- Adds a MySQL User for user
- Grants all privileges to user to his/her database
**Sample Output**
km@KM-VBox:~$ ./newuser.bash test1
Creating user: test1
Password: zV8MDMRh
[sudo] password for km:
Creating mysql user & database for test1
[Short demo on Screenr (1min)](http://screenr.com/ghzs)