Step 1: Login to MySQL ( you will need an account )
[code]user@server:~$ mysql -u mysql_user -p
Step 2: Create the Database
[code]mysql > create database db_name;[/code]
Step 3: Verify that it’s there
[code]mysql > show databases;[/code]
Step 4: Create the User
[code]mysql > create user db_user;[/code]
Step 5: Grant privileges while assigning the password
[code]mysql > grant all on db_name.* to ‘db_user’@’localhost’ identified by ‘db_password’;[/code]
*Note: The localhost field usually doesn’t have to be edited, but you can set it to the specific address.
The above example grants all privileges, obviously. But you will likely want to limit privileges under many circumstances. These parameters include select, insert, and delete.
Choose all that apply and separate by comma:
[code]mysql > grant select, insert, delete, update on db_name.* to ‘db_user’@’localhost’ identified by ‘db_password’;[/code]